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 (
    43593, 43592, 43591, 43590, 43589, 43588, 
    43587, 43586, 43585, 43584, 43583, 
    43582, 43581, 43580, 43579, 43578, 
    43577, 43576, 43575, 43574
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00041

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
43574 1M
43575 4M
43576 1M
43577 3M
43578 1M
43579 4M
43580 1M
43581 1M
43582 3M
43583 4M
43584 3M
43585 1M
43586 1M
43587 4M
43588 1M
43589 1M
43590 4M
43591 1M
43592 1M
43593 1M