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 = 23 
WHERE 
  cscart_products_categories.product_id IN (
    107, 73, 102, 1154, 1155, 307, 1157, 1156, 
    227, 487, 1153, 324, 229, 228, 1152, 
    1151, 1149, 1067, 1150, 1063, 1064, 
    905, 490, 1333, 1334, 1332, 567, 570, 
    568, 907, 1000, 999, 995, 1001, 996, 
    992, 998, 997, 993, 991, 909, 908, 1070, 
    469, 225, 226, 1095, 569, 612, 1025, 
    1026, 1016, 1055, 975, 976, 418, 1148, 
    472
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00226

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": 59,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (107,73,102,1154,1155,307,1157,1156,227,487,1153,324,229,228,1152,1151,1149,1067,1150,1063,1064,905,490,1333,1334,1332,567,570,568,907,1000,999,995,1001,996,992,998,997,993,991,909,908,1070,469,225,226,1095,569,612,1025,1026,1016,1055,975,976,418,1148,472)"
    },
    "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
73 23M 0
102 23M 0
107 23M 0
225 23M 0
226 23M 0
227 23M 0
228 23M 0
229 23M 0
307 23M 0
324 23M 0
418 23M 0
469 23M 0
472 23M 0
487 23M 0
490 23M 0
567 23M 0
568 23M 0
569 23M 0
570 23M 0
612 23M 0
905 23M 0
907 23M 0
908 23M 0
909 23M 0
975 23M 0
976 23M 0
991 23M 0
992 23M 0
993 23M 0
995 23M 0
996 23M 0
997 23M 0
998 23M 0
999 23M 0
1000 23M 0
1001 23M 0
1016 23M 0
1025 23M 0
1026 23M 0
1055 23M 0
1063 23M 0
1064 23M 0
1067 23M 0
1070 23M 0
1095 23M 0
1148 23M 0
1149 23M 0
1150 23M 0
1151 23M 0
1152 23M 0
1153 23M 0
1154 23M 0
1155 23M 0
1156 23M 0
1157 23M 0
1332 23M 0
1333 23M 0
1334 23M 0