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 (
    63613, 63611, 63610, 63609, 63608, 63607, 
    63606, 63605, 63604, 63046, 63045, 
    63044, 63043, 63042, 63041, 63040, 
    63039, 63038, 63037, 63036
  ) 
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 23 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
63036 22M
63037 22M
63038 22M
63039 22M
63040 22M
63041 22M
63042 22M
63043 22M
63044 22M
63045 22M
63046 23,13M
63604 29,4M
63605 4M
63606 4M
63607 4M
63608 4M
63609 4M
63610 4M
63611 31,3M
63613 4M