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 (
    44451, 44450, 44449, 44448, 44447, 44446, 
    44445, 44444, 44443, 44442, 44441, 
    44440, 44439, 44438, 44437, 44436, 
    44435, 44434, 44433, 44432
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00073

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
44432 1M
44433 1M
44434 1M
44435 1M
44436 3M
44437 1M
44438 4M
44439 1M
44440 3M
44441 4M
44442 1M
44443 1M
44444 4M
44445 1M
44446 4M
44447 1M
44448 1M
44449 1M
44450 31,3M
44451 1M