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 (
    43273, 43272, 43271, 43270, 43269, 43268, 
    43267, 43266, 43265, 43264, 43263, 
    43262, 43261, 43260, 43259, 43258, 
    43257, 43256, 43255, 43254, 43253, 
    43252, 43251, 43250, 43249
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00047

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
43249 22M
43250 22M
43251 22M
43252 22M
43253 22M
43254 22M
43255 22M
43256 22M
43257 22M
43258 22M
43259 22M
43260 22M
43261 22M
43262 22M
43263 22M
43264 22M
43265 22M
43266 22M
43267 22M
43268 22M
43269 22M
43270 22M
43271 22M
43272 22M
43273 22M