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 = 7257 
WHERE 
  cscart_products_categories.product_id IN (
    93008, 93009, 93010, 93011, 93012, 93013, 
    93014, 93015, 93341, 93342, 93343, 
    93344, 93345, 93346, 93347, 93348, 
    93349, 93350, 93351, 93352, 93353, 
    93354, 93355, 93750, 93751, 93752, 
    93792, 93793, 93794, 93848, 93849, 
    93886, 93887, 93888, 93889, 93890, 
    93891, 93892, 93893, 94119, 94120, 
    94121, 94122, 94123, 94124, 94125, 
    94126, 94127, 94128, 94129, 94130, 
    94131, 94132, 94133, 94134, 94135, 
    94136, 94137, 94138, 94139, 94457, 
    94484, 94485, 94486, 94487, 94488, 
    94489, 94490, 94491, 94492, 94493, 
    94494, 94495, 94496, 94497, 94498, 
    94499, 94500, 94501, 94502, 94503, 
    94505, 94506, 94507, 94508, 94509, 
    94510, 94511, 94512, 94513, 94514, 
    94515, 94516, 94517, 94518, 94519
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01742

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "135.34"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "10.07"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "ALL",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "rows_examined_per_scan": 208,
            "rows_produced_per_join": 8,
            "filtered": "4.00",
            "cost_info": {
              "read_cost": "20.72",
              "eval_cost": "0.83",
              "prefix_cost": "21.55",
              "data_read_per_join": "21K"
            },
            "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')))"
          }
        },
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "nuie_scalesta_net.cscart_categories.category_id"
            ],
            "rows_examined_per_scan": 117,
            "rows_produced_per_join": 10,
            "filtered": "1.03",
            "cost_info": {
              "read_cost": "2.33",
              "eval_cost": "1.01",
              "prefix_cost": "121.75",
              "data_read_per_join": "161"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (93008,93009,93010,93011,93012,93013,93014,93015,93341,93342,93343,93344,93345,93346,93347,93348,93349,93350,93351,93352,93353,93354,93355,93750,93751,93752,93792,93793,93794,93848,93849,93886,93887,93888,93889,93890,93891,93892,93893,94119,94120,94121,94122,94123,94124,94125,94126,94127,94128,94129,94130,94131,94132,94133,94134,94135,94136,94137,94138,94139,94457,94484,94485,94486,94487,94488,94489,94490,94491,94492,94493,94494,94495,94496,94497,94498,94499,94500,94501,94502,94503,94505,94506,94507,94508,94509,94510,94511,94512,94513,94514,94515,94516,94517,94518,94519))"
          }
        },
        {
          "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": 10,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.52",
              "eval_cost": "1.01",
              "prefix_cost": "125.27",
              "data_read_per_join": "161"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
93008 7208M,7241,7309,7346
93009 7208M,7241,7309,7346
93010 7208M,7241,7309,7346
93011 7208M,7241,7309,7346
93012 7208M,7241,7309,7346
93013 7208M,7241,7309,7346
93014 7208M,7241,7309,7346
93015 7208M,7241,7309,7346
93341 7208M,7241,7309,7346
93342 7208M,7241,7309,7346
93343 7208M,7241,7309,7346
93344 7208M,7241,7309,7346
93345 7208M,7241,7309,7346
93346 7208M,7241,7309,7346
93347 7208M,7241,7309,7346
93348 7208M,7241,7309,7346
93349 7208M,7241,7309,7346
93350 7208M,7241,7309,7346
93351 7208M,7241,7309,7346
93352 7208M,7241,7309,7346
93353 7208M,7241,7309,7346
93354 7208M,7241,7309,7346
93355 7208M,7241,7309,7346
93750 7208M,7241,7309,7346
93751 7208M,7241,7309,7346
93752 7208M,7241,7309,7346
93792 7258M
93793 7258M
93794 7259M,7345,7347
93848 7208M,7241,7309,7346
93849 7208M,7241,7309,7346
93886 7208M,7241,7309,7346
93887 7208M,7241,7309,7346
93888 7208M,7241,7309,7346
93889 7208M,7241,7309,7346
93890 7208M,7241,7309,7346
93891 7208M,7241,7309,7346
93892 7208M,7241,7309,7346
93893 7208M,7241,7309,7346
94119 7247M,7265
94120 7247M,7265
94121 7247M,7265
94122 7247M,7265
94123 7247M,7265
94124 7247M,7265
94125 7247M,7265
94126 7247M,7265
94127 7247M,7265
94128 7247M,7265
94129 7247M,7265
94130 7247M,7265
94131 7247M,7265
94132 7247M,7265
94133 7247M,7265
94134 7247M,7265
94135 7247M,7265
94136 7247M,7265
94137 7247M,7265
94138 7247M,7265
94139 7247M,7265
94457 7247M,7265
94484 7260M,7320
94485 7261M,7349
94486 7260M,7320
94487 7260M,7320
94488 7260M,7320
94489 7260M,7320
94490 7260M,7320
94491 7260M,7320
94492 7261M,7349
94493 7260M,7320
94494 7260M,7320
94495 7258M
94496 7259M,7345,7347
94497 7258M
94498 7258M
94499 7259M,7345,7347
94500 7258M
94501 7259M,7345,7347
94502 7258M
94503 7258M
94505 7260M,7320
94506 7260M,7320
94507 7260M,7320
94508 7258M
94509 7260M,7320
94510 7261M,7349
94511 7260M,7320
94512 7260M,7320
94513 7260M,7320
94514 7258M
94515 7259M,7345,7347
94516 7260M,7320
94517 7260M,7320
94518 7260M,7320
94519 7260M,7320