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 
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') 
WHERE 
  cscart_products_categories.product_id IN (
    10572, 10569, 10568, 10567, 10566, 10565, 
    10563, 10561, 10560, 10558, 10557, 
    10556, 10552, 10551, 10550, 15943, 
    10545, 10544, 10543, 10542, 10541, 
    10540, 10539, 10538, 10537, 10536, 
    10535, 10534, 10533, 10532, 10531, 
    10530
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00164

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": 35,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (10572,10569,10568,10567,10566,10565,10563,10561,10560,10558,10557,10556,10552,10551,10550,15943,10545,10544,10543,10542,10541,10540,10539,10538,10537,10536,10535,10534,10533,10532,10531,10530)"
    },
    "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": ["noframes_angrybeaver.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')"
    }
  }
}

Result

product_id category_ids
10530 1657M
10531 1657M
10532 1657M
10533 1657M
10534 1657M
10535 1657M
10536 1657M
10537 1657M
10538 1657M
10539 1657M
10540 1657M
10541 1657M
10542 1657M
10543 1657M
10544 1657M
10545 275M
10550 275M
10551 275M
10552 275M
10556 275M
10557 275M
10558 275M
10560 275M
10561 275M
10563 275M
10565 275M
10566 275M
10567 275M
10568 275M
10569 275M
10572 275M
15943 272M