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 (
    44071, 44070, 44069, 44068, 44067, 44066, 
    44065, 44064, 44063, 44062, 44061, 
    44060, 44059, 44058, 44057, 44056, 
    44055, 44054, 44053, 44052, 44051, 
    44050, 44049, 44048, 44047
  ) 
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 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
44047 22M
44048 22M
44049 22M
44050 22M
44051 22M
44052 22M
44053 22M
44054 22M
44055 22M
44056 22M
44057 22M
44058 22M
44059 22M
44060 22M
44061 22M
44062 22M
44063 22M
44064 22M
44065 22M
44066 22M
44067 22M
44068 22M
44069 22M
44070 22M
44071 22M