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 (
    60679, 60678, 60677, 60676, 60675, 60674, 
    60673, 60672, 60671, 60670, 60669, 
    60668, 60667, 60312, 60311, 60310, 
    60309, 60308, 60307, 60306
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00045

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 21 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
60306 4M
60307 4M
60308 4M
60309 4M
60310 4M
60311 4M
60312 18,13M
60667 1M
60668 1M
60669 1M
60670 1M
60671 1M
60672 1M
60673 1M
60674 1M
60675 1M
60676 1M
60677 1M
60678 1M
60679 1M