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 = 53 
WHERE 
  cscart_products_categories.product_id IN (
    16373, 17322, 16038, 16040, 16068, 26877, 
    16042, 30843, 16059, 16053, 30867, 
    16041, 16078, 16072, 16034, 16110, 
    30863, 30831, 16113, 28378, 33825, 
    30832, 30828, 16060, 16114, 39227, 
    16083, 36946, 37201, 39214, 34334, 
    40861, 37122, 17366, 38258, 37089, 
    40656, 34575, 40670, 40865, 37126, 
    38254, 34326, 40874, 37147, 37120, 
    40862, 40873, 34288, 37154
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00208

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "118.31"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 92,
            "rows_produced_per_join": 92,
            "filtered": "100.00",
            "index_condition": "(`cscartdb`.`cscart_products_categories`.`product_id` in (16373,17322,16038,16040,16068,26877,16042,30843,16059,16053,30867,16041,16078,16072,16034,16110,30863,30831,16113,28378,33825,30832,30828,16060,16114,39227,16083,36946,37201,39214,34334,40861,37122,17366,38258,37089,40656,34575,40670,40865,37126,38254,34326,40874,37147,37120,40862,40873,34288,37154))",
            "cost_info": {
              "read_cost": "44.71",
              "eval_cost": "9.20",
              "prefix_cost": "53.91",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ]
          }
        },
        {
          "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",
              "cscartdb.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 92,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "23.00",
              "eval_cost": "9.20",
              "prefix_cost": "86.11",
              "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": [
              "cscartdb.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 4,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "23.00",
              "eval_cost": "0.46",
              "prefix_cost": "118.31",
              "data_read_per_join": "15K"
            },
            "used_columns": [
              "category_id",
              "storefront_id",
              "usergroup_ids",
              "status"
            ],
            "attached_condition": "((`cscartdb`.`cscart_categories`.`storefront_id` in (0,1)) and ((`cscartdb`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`cscartdb`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`cscartdb`.`cscart_categories`.`usergroup_ids`))) and (`cscartdb`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
16034 601,53M 0
16038 601,53M 0
16040 601,53M 0
16041 601,53M 0
16042 601,53M 0
16053 601,53M 0
16059 601,53M 0
16060 601,53M 0
16068 599,53M 0
16072 599,53M 0
16078 599,53M 0
16083 601,53M 0
16110 599,53M 0
16113 601,53M 0
16114 599,53M 0
16373 622,53M 0
17322 690,53M 1
17366 690,53M 0
26877 601,53M 0
28378 601,53M 0
30828 930,53M 0
30831 930,53M 0
30832 930,53M 0
30843 930,53M 0
30863 930,53M 0
30867 930,53M 0
33825 601,53M 0
34288 987,53M 0
34326 987,53M 0
34334 991,53M 0
34575 991,53M 0
36946 1059,53M 0
37089 1065,53M 0
37120 1065,53M 0
37122 1065,53M 0
37126 1062,53M 0
37147 1065,53M 0
37154 1065,53M 0
37201 1069,53M 0
38254 1128,53M 0
38258 1128,53M 0
39214 1216,53M 0
39227 1216,53M 0
40656 1212,53M 0
40670 1231,53M 0
40861 1191,53M 0
40862 1191,53M 0
40865 1191,53M 0
40873 1191,53M 0
40874 1191,53M 0