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 (
    59575, 59574, 59573, 59572, 59571, 59570, 
    59569, 59568, 59567, 59566, 59565, 
    59564, 59563, 59562, 59561, 59560, 
    59559, 59558, 59557, 59556
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00044

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 20 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
59556 4M
59557 4M
59558 4M
59559 4M
59560 4M
59561 4M
59562 4M
59563 4M
59564 4M
59565 4M
59566 4M
59567 4M
59568 4M
59569 4M
59570 4M
59571 4M
59572 4M
59573 4M
59574 4M
59575 4M