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 (
    44874, 44873, 44872, 44871, 44870, 44869, 
    44868, 44866, 44865, 44864, 44863, 
    44862, 44861, 44860, 44859, 44858, 
    44857, 44856, 44453, 44452
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00043

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
44452 1M
44453 17,13M
44856 1M
44857 4M
44858 3M
44859 1M
44860 1M
44861 1M
44862 1M
44863 1M
44864 1M
44865 1M
44866 1M
44868 1M
44869 1M
44870 3M
44871 3M
44872 4M
44873 4M
44874 1M