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 = 7210 
WHERE 
  cscart_products_categories.product_id IN (
    87759, 88019, 87992, 88001, 88005, 87939, 
    87989, 88594, 87943, 87973, 87999, 
    90808, 87965, 88014, 88020, 92893, 
    92894, 93002, 93003, 93004, 93005, 
    93006, 93007, 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
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01619

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "136.44"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "10.89"
      },
      "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.11",
            "cost_info": {
              "read_cost": "2.33",
              "eval_cost": "1.09",
              "prefix_cost": "121.75",
              "data_read_per_join": "174"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (87759,88019,87992,88001,88005,87939,87989,88594,87943,87973,87999,90808,87965,88014,88020,92893,92894,93002,93003,93004,93005,93006,93007,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))"
          }
        },
        {
          "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.72",
              "eval_cost": "1.09",
              "prefix_cost": "125.56",
              "data_read_per_join": "174"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
87759 7210,7307,7308M 0
87939 7261M,7349
87943 7261M,7349
87965 7261M,7349
87973 7261M,7349
87989 7261M,7349
87992 7261M,7349
87999 7261M,7349
88001 7261M,7349
88005 7261M,7349
88014 7261M,7349
88019 7261M,7349
88020 7261M,7349
88594 7210,7211,7282M 0
90808 7261M,7349
92893 7208M,7241,7309,7346
92894 7208M,7241,7309,7346
93002 7208M,7241,7309,7346
93003 7208M,7241,7309,7346
93004 7208M,7241,7309,7346
93005 7208M,7241,7309,7346
93006 7208M,7241,7309,7346
93007 7208M,7241,7309,7346
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