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 = 16 
WHERE 
  cscart_products_categories.product_id IN (
    712, 693, 691, 1013, 762, 1241, 1264, 
    723, 751, 503, 628, 467, 754, 752, 655, 
    761, 1142, 1141, 1146, 721, 722, 615, 
    524, 1140, 1143, 1144, 293, 924, 750, 
    898, 565, 447, 460, 482, 1408, 1047, 
    463, 824, 521, 54, 292, 351, 343, 384, 
    340, 1139, 825, 672, 532, 623, 509, 897, 
    361, 512, 746, 740, 984, 707, 317, 745, 
    529, 834, 380, 1278, 436, 586, 596, 1075, 
    450, 743, 741, 449, 747, 1053, 415, 45, 
    1074, 1240, 431, 1244, 1050, 1052, 1089, 
    939, 889, 1107, 620, 379, 903, 316, 594, 
    533, 812, 430, 451, 614
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00295

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_products_categories",
      "access_type": "range",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "pt",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "rows": 97,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (712,693,691,1013,762,1241,1264,723,751,503,628,467,754,752,655,761,1142,1141,1146,721,722,615,524,1140,1143,1144,293,924,750,898,565,447,460,482,1408,1047,463,824,521,54,292,351,343,384,340,1139,825,672,532,623,509,897,361,512,746,740,984,707,317,745,529,834,380,1278,436,586,596,1075,450,743,741,449,747,1053,415,45,1074,1240,431,1244,1050,1052,1089,939,889,1107,620,379,903,316,594,533,812,430,451,614)"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["bacpvdev_db.cscart_products_categories.category_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "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')"
    },
    "table": {
      "table_name": "product_position_source",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "PRIMARY",
      "key_length": "6",
      "used_key_parts": ["category_id", "product_id"],
      "ref": ["const", "bacpvdev_db.cscart_products_categories.product_id"],
      "rows": 1,
      "filtered": 100
    }
  }
}

Result

product_id category_ids position
45 16M 0
54 16M 0
292 16M 0
293 16M 0
316 16M 0
317 16M 0
340 16M 0
343 16M 0
351 16M 0
361 16M 0
379 16M 0
380 16M 0
384 16M 0
415 16M 0
430 16M 0
431 16M 0
436 16M 0
447 16M 0
449 16M 0
450 16M 0
451 16M 0
460 16M 0
463 16M 0
467 16M 0
482 16M 0
503 16M 0
509 16M 0
512 16M 0
521 16M 0
524 16M 0
529 16M 0
532 16M 0
533 16M 0
565 16M 0
586 16M 0
594 16M 0
596 16M 0
614 16M 0
615 16M 0
620 16M 0
623 16M 0
628 16M 0
655 16M 0
672 16M 0
691 16M 0
693 16M 0
707 16M 0
712 16M 0
721 16M 0
722 16M 0
723 16M 0
740 16M 0
741 16M 0
743 16M 0
745 16M 0
746 16M 0
747 16M 0
750 16M 0
751 16M 0
752 16M 0
754 16M 0
761 16M 0
762 16M 0
812 16M 0
824 16M 0
825 16M 0
834 16M 0
889 16M 0
897 16M 0
898 16M 0
903 16M 0
924 16M 0
939 16M 0
984 16M 0
1013 16M 0
1047 16M 0
1050 16M 0
1052 16M 0
1053 16M 0
1074 16M 0
1075 16M 0
1089 16M 0
1107 16M 0
1139 16M 0
1140 16M 0
1141 16M 0
1142 16M 0
1143 16M 0
1144 16M 0
1146 16M 0
1240 16M 0
1241 16M 0
1244 16M 0
1264 16M 0
1278 16M 0
1408 16M 0