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 = 7211 
WHERE 
  cscart_products_categories.product_id IN (
    88799, 88006, 88013, 88015, 87972, 88703, 
    88750, 87944, 88595, 88154, 87874, 
    87783, 87880, 87873, 88797, 87782, 
    88701, 88748, 88596, 88594, 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
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00083

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "96.23"
    },
    "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": 169,
            "rows_produced_per_join": 169,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "17.22",
              "eval_cost": "16.90",
              "prefix_cost": "34.12",
              "data_read_per_join": "2K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (88799,88006,88013,88015,87972,88703,88750,87944,88595,88154,87874,87783,87880,87873,88797,87782,88701,88748,88596,88594,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))"
          }
        },
        {
          "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": 8,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "42.25",
              "eval_cost": "0.85",
              "prefix_cost": "93.27",
              "data_read_per_join": "22K"
            },
            "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": "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": 8,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.11",
              "eval_cost": "0.85",
              "prefix_cost": "96.23",
              "data_read_per_join": "135"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
87782 7210,7211,7321M 0
87783 7210,7211,7321M 0
87873 7241,7309,7346,7208M
87874 7241,7309,7346,7208M
87880 7241,7309,7346,7208M
87944 7320,7260M
87972 7320,7260M
88006 7320,7260M
88013 7320,7260M
88015 7320,7260M
88154 7320,7260M
88594 7210,7211,7282M 0
88595 7210,7211,7282M 0
88596 7210,7211,7282M 0
88701 7210,7211,7282M 0
88703 7210,7211,7282M 0
88748 7210,7211,7282M 0
88750 7210,7211,7282M 0
88797 7210,7211,7282M 0
88799 7210,7211,7282M 0
92893 7241,7309,7346,7208M
92894 7241,7309,7346,7208M
93002 7241,7309,7346,7208M
93003 7241,7309,7346,7208M
93004 7241,7309,7346,7208M
93005 7241,7309,7346,7208M
93006 7241,7309,7346,7208M
93007 7241,7309,7346,7208M
93008 7241,7309,7346,7208M
93009 7241,7309,7346,7208M
93010 7241,7309,7346,7208M
93011 7241,7309,7346,7208M
93012 7241,7309,7346,7208M
93013 7241,7309,7346,7208M
93014 7241,7309,7346,7208M
93015 7241,7309,7346,7208M
93341 7241,7309,7346,7208M
93342 7241,7309,7346,7208M
93343 7241,7309,7346,7208M
93344 7241,7309,7346,7208M
93345 7241,7309,7346,7208M
93346 7241,7309,7346,7208M
93347 7241,7309,7346,7208M
93348 7241,7309,7346,7208M
93349 7241,7309,7346,7208M
93350 7241,7309,7346,7208M
93351 7241,7309,7346,7208M
93352 7241,7309,7346,7208M