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 (
    10615, 10614, 10613, 10612, 10611, 10610, 
    10609, 10608, 10607, 10600, 10599, 
    10598, 10597, 10596, 15952, 15951, 
    15950, 15949, 15947, 15946, 15945, 
    15944, 10583, 10582, 10581, 10580, 
    10579, 10578, 10577, 10576, 10575, 
    10573, 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.00076

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": 91,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (10615,10614,10613,10612,10611,10610,10609,10608,10607,10600,10599,10598,10597,10596,15952,15951,15950,15949,15947,15946,15945,15944,10583,10582,10581,10580,10579,10578,10577,10576,10575,10573,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
10573 275M
10575 275M
10576 275M
10577 275M
10578 275M
10579 275M
10580 275M
10581 275M
10582 275M
10583 275M
10596 455M
10597 455M
10598 455M
10599 455M
10600 455M
10607 1659M
10608 1659M
10609 1659M
10610 1659M
10611 1659M
10612 1659M
10613 1659M
10614 1659M
10615 1659M
15943 272M
15944 272M
15945 272M
15946 272M
15947 272M
15949 272M
15950 272M
15951 272M
15952 272M