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 (
    2721, 2202, 2625, 2678, 2824, 2776, 2826, 
    2775, 2777, 2823, 13441, 13762, 11667, 
    11666, 11668, 11665, 13106, 15112, 
    13839, 13838, 13140, 13828, 12505, 
    13829, 13830, 15426, 2567, 2557, 2569, 
    2556
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00055

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": 44,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (2721,2202,2625,2678,2824,2776,2826,2775,2777,2823,13441,13762,11667,11666,11668,11665,13106,15112,13839,13838,13140,13828,12505,13829,13830,15426,2567,2557,2569,2556)"
    },
    "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": ["ymonline_livedata.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
2202 357M
2556 356M
2557 356M
2567 356M
2569 356M
2625 356M
2678 356M
2721 356M
2775 356M
2776 356M
2777 356M
2823 356M
2824 356M
2826 356M
11665 383,265M
11666 383,265M
11667 383,265M
11668 383,265M
12505 383M
13106 383,265M
13140 265M
13441 383,265M
13762 383,265M
13828 383,265M
13829 383,265M
13830 383,265M
13838 383,265M
13839 383,265M
15112 383,265M
15426 356,265M