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 (
    457753, 457758, 457766, 457790, 457596, 
    457603, 457625, 457657, 457660, 457678, 
    457686, 457495, 457520, 457524, 457561, 
    457563, 457573, 457581, 457584, 457492, 
    457385, 457400, 457421, 457433
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00049

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.081460403,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_products_categories",
          "access_type": "range",
          "possible_keys": ["PRIMARY", "pt"],
          "key": "pt",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "loops": 1,
          "rows": 24,
          "cost": 0.04381364,
          "filtered": 100,
          "attached_condition": "cscart_products_categories.product_id in (457753,457758,457766,457790,457596,457603,457625,457657,457660,457678,457686,457495,457520,457524,457561,457563,457573,457581,457584,457492,457385,457400,457421,457433)",
          "using_index": true
        }
      },
      {
        "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": ["u985510652_ecartify.cscart_products_categories.category_id"],
          "loops": 24,
          "rows": 1,
          "cost": 0.02228576,
          "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
457385 500M
457400 495M
457421 495M
457433 498M
457492 289M
457495 495M
457520 289M
457524 289M
457561 289M
457563 500M
457573 289M
457581 289M
457584 495M
457596 498M
457603 495M
457625 289M
457657 500M
457660 500M
457678 495M
457686 305M
457753 495M
457758 289M
457766 289M
457790 289M