SELECT 
  cscart_products_categories.product_id, 
  GROUP_CONCAT(
    IF(
      cscart_products_categories.link_type = "M", 
      CONCAT(
        cscart_products_categories.category_id, 
        "M"
      ), 
      cscart_products_categories.category_id
    )
  ) AS category_ids, 
  product_position_source.position AS position 
FROM 
  cscart_products_categories 
  INNER JOIN cscart_categories ON cscart_categories.category_id = cscart_products_categories.category_id 
  AND cscart_categories.storefront_id IN (0, 1) 
  AND (
    cscart_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_categories.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A', 'H') 
  LEFT JOIN cscart_products_categories AS product_position_source ON cscart_products_categories.product_id = product_position_source.product_id 
  AND product_position_source.category_id = 7165 
WHERE 
  cscart_products_categories.product_id IN (
    93321, 93322, 93323, 93324, 93325, 93326, 
    93327, 93328, 93329, 93330, 93331, 
    93332, 93333, 93334, 93335, 93336, 
    93337, 93356, 93357, 93358, 93868, 
    93869, 93870, 93871, 93896, 93897, 
    93898, 93899, 93900, 93901, 93902, 
    93903, 93904, 93905, 93906, 93907, 
    93908, 93909, 93910, 93911, 93912, 
    93913, 93914, 93915, 93916, 93917, 
    93918, 93919
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00113

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "52.48"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 58,
            "rows_produced_per_join": 58,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "6.08",
              "eval_cost": "5.80",
              "prefix_cost": "11.88",
              "data_read_per_join": "928"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (93321,93322,93323,93324,93325,93326,93327,93328,93329,93330,93331,93332,93333,93334,93335,93336,93337,93356,93357,93358,93868,93869,93870,93871,93896,93897,93898,93899,93900,93901,93902,93903,93904,93905,93906,93907,93908,93909,93910,93911,93912,93913,93914,93915,93916,93917,93918,93919))"
          }
        },
        {
          "table": {
            "table_name": "product_position_source",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "product_id"
            ],
            "key_length": "6",
            "ref": [
              "const",
              "nuie_scalesta_net.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 58,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "14.50",
              "eval_cost": "5.80",
              "prefix_cost": "32.18",
              "data_read_per_join": "928"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "nuie_scalesta_net.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 2,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "14.50",
              "eval_cost": "0.29",
              "prefix_cost": "52.48",
              "data_read_per_join": "7K"
            },
            "used_columns": [
              "category_id",
              "usergroup_ids",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`nuie_scalesta_net`.`cscart_categories`.`storefront_id` in (0,1)) and ((`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`))) and (`nuie_scalesta_net`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
93321 7168M
93322 7168M
93323 7168M
93324 7168M
93325 7168M
93326 7168M
93327 7168M
93328 7168M
93329 7168M
93330 7168M
93331 7168M
93332 7168M
93333 7168M
93334 7168M
93335 7168M
93336 7168M
93337 7168M
93356 7183,7283,7167M
93357 7183,7283,7167M
93358 7183,7283,7167M
93868 7226,7225M
93869 7226,7225M
93870 7226,7225M
93871 7226,7225M
93896 7168M
93897 7168M
93898 7168M
93899 7168M
93900 7168M
93901 7168M
93902 7172M
93903 7172M
93904 7172M
93905 7172M
93906 7172M
93907 7168M
93908 7168M
93909 7168M
93910 7172M
93911 7172M
93912 7172M
93913 7168M
93914 7168M
93915 7168M
93916 7168M
93917 7168M
93918 7168M
93919 7168M