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 (
    60311, 60310, 60309, 60308, 60307, 60306, 
    60305, 60304, 60303, 60302, 60301, 
    60300, 60299, 60298, 60297, 60296, 
    60295, 60294, 60293, 60292, 60291, 
    60290, 60289, 60288, 60287
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00039

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 25 Using where; Using index
1 SIMPLE cscart_categories eq_ref PRIMARY,c_status,p_category_id PRIMARY 3 toolboxdigitalshop_dev.cscart_products_categories.category_id 1 Using where

Result

product_id category_ids
60287 4M
60288 4M
60289 4M
60290 4M
60291 4M
60292 4M
60293 4M
60294 4M
60295 4M
60296 4M
60297 4M
60298 4M
60299 4M
60300 4M
60301 4M
60302 4M
60303 4M
60304 4M
60305 4M
60306 4M
60307 4M
60308 4M
60309 4M
60310 4M
60311 4M