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 = 7228 
WHERE 
  cscart_products_categories.product_id IN (
    96073, 96074, 96075, 96076, 96077, 96078, 
    96079, 96080, 96081, 96082, 96083, 
    96084, 96085, 96086, 96087, 96088, 
    96089, 96090, 96091, 96092, 96093, 
    96094, 96095, 96096, 96097, 96098, 
    96099, 96100, 96101, 96102, 96103, 
    96104, 96105, 96106, 96107, 96108, 
    96109, 96110, 96111, 96112, 96113, 
    96114, 96115, 96116, 96350, 96351, 
    96352, 96353, 96354, 96355, 96356, 
    96357, 96358, 96359, 96360, 96361, 
    96362, 96363, 96364, 96365, 96366, 
    96367, 96368, 96369, 96370, 96371, 
    96372, 96373, 96374, 96375, 96376, 
    96377, 96378, 96379, 96380, 96381, 
    96382, 96383, 96384, 96385, 96386, 
    96387, 96388, 96389, 96390, 96391, 
    96392, 96393, 96394, 96395, 96396, 
    96397, 96398, 96399, 96400, 96401
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00641

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "86.69"
    },
    "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": 96,
            "rows_produced_per_join": 96,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "9.89",
              "eval_cost": "9.60",
              "prefix_cost": "19.49",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (96073,96074,96075,96076,96077,96078,96079,96080,96081,96082,96083,96084,96085,96086,96087,96088,96089,96090,96091,96092,96093,96094,96095,96096,96097,96098,96099,96100,96101,96102,96103,96104,96105,96106,96107,96108,96109,96110,96111,96112,96113,96114,96115,96116,96350,96351,96352,96353,96354,96355,96356,96357,96358,96359,96360,96361,96362,96363,96364,96365,96366,96367,96368,96369,96370,96371,96372,96373,96374,96375,96376,96377,96378,96379,96380,96381,96382,96383,96384,96385,96386,96387,96388,96389,96390,96391,96392,96393,96394,96395,96396,96397,96398,96399,96400,96401))"
          }
        },
        {
          "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": 96,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "24.00",
              "eval_cost": "9.60",
              "prefix_cost": "53.09",
              "data_read_per_join": "1K"
            },
            "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": 4,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "24.00",
              "eval_cost": "0.48",
              "prefix_cost": "86.69",
              "data_read_per_join": "12K"
            },
            "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
96073 7234M
96074 7231M
96075 7234M
96076 7231M
96077 7234M
96078 7231M
96079 7234M
96080 7234M
96081 7234M
96082 7231M
96083 7231M
96084 7234M
96085 7234M
96086 7231M
96087 7231M
96088 7234M
96089 7234M
96090 7231M
96091 7231M
96092 7234M
96093 7234M
96094 7231M
96095 7231M
96096 7234M
96097 7234M
96098 7231M
96099 7231M
96100 7234M
96101 7234M
96102 7231M
96103 7231M
96104 7234M
96105 7229M
96106 7229M
96107 7229M
96108 7229M
96109 7229M
96110 7229M
96111 7229M
96112 7229M
96113 7229M
96114 7229M
96115 7229M
96116 7229M
96350 7229M
96351 7229M
96352 7229M
96353 7229M
96354 7229M
96355 7229M
96356 7229M
96357 7229M
96358 7229M
96359 7229M
96360 7229M
96361 7229M
96362 7229M
96363 7229M
96364 7229M
96365 7229M
96366 7229M
96367 7229M
96368 7229M
96369 7229M
96370 7229M
96371 7229M
96372 7229M
96373 7229M
96374 7229M
96375 7229M
96376 7229M
96377 7229M
96378 7229M
96379 7229M
96380 7229M
96381 7229M
96382 7229M
96383 7231M
96384 7231M
96385 7231M
96386 7231M
96387 7231M
96388 7231M
96389 7231M
96390 7231M
96391 7231M
96392 7229M
96393 7229M
96394 7234M
96395 7234M
96396 7234M
96397 7234M
96398 7231M
96399 7231M
96400 7231M
96401 7229M