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 = 19 
WHERE 
  cscart_products_categories.product_id IN (
    802, 207, 205, 206, 201, 204, 203, 202, 
    597, 589, 1750, 713, 466, 535, 423, 534, 
    501, 1493, 531, 465, 588, 644, 640, 646, 
    643, 642, 641, 645, 507, 814, 815, 218, 
    1119, 1120, 1121, 861, 859, 437, 428, 
    843, 862, 1108, 267, 857, 1749, 396, 
    1659, 791, 474, 426, 793, 794, 1147, 
    849, 850, 852, 853, 851, 855, 854, 856, 
    208, 209, 210, 886, 555, 630, 554, 1109, 
    320, 318, 319, 969, 970, 252, 454, 639, 
    49
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00241

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": 79,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (802,207,205,206,201,204,203,202,597,589,1750,713,466,535,423,534,501,1493,531,465,588,644,640,646,643,642,641,645,507,814,815,218,1119,1120,1121,861,859,437,428,843,862,1108,267,857,1749,396,1659,791,474,426,793,794,1147,849,850,852,853,851,855,854,856,208,209,210,886,555,630,554,1109,320,318,319,969,970,252,454,639,49)"
    },
    "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
49 19M 0
201 19M 0
202 19M 0
203 19M 0
204 19M 0
205 19M 0
206 19M 0
207 19M 0
208 19M 0
209 19M 0
210 19M 0
218 19M 0
252 19M 0
267 19M 0
318 19M 0
319 19M 0
320 19M 0
396 19M 0
423 19M 0
426 19M 0
428 19M 0
437 19M 0
454 19M 0
465 19M 0
466 19M 0
474 19M 0
501 19M 0
507 19M 0
531 19M 0
534 19M 0
535 19M 0
554 19M 0
555 19M 0
588 19M 0
589 19M 0
597 19M 0
630 19M 0
639 19M 0
640 19M 0
641 19M 0
642 19M 0
643 19M 0
644 19M 0
645 19M 0
646 19M 0
713 19M 0
791 19M 0
793 19M 0
794 19M 0
802 19M 0
814 19M 0
815 19M 0
843 19M 0
849 19M 0
850 19M 0
851 19M 0
852 19M 0
853 19M 0
854 19M 0
855 19M 0
856 19M 0
857 19M 0
859 19M 0
861 19M 0
862 19M 0
886 19M 0
969 19M 0
970 19M 0
1108 19M 0
1109 19M 0
1119 19M 0
1120 19M 0
1121 19M 0
1147 19M 0
1493 19M 0
1659 19M 0
1749 19M 0
1750 19M 0