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, 
  product_position_source.position AS position 
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') 
  LEFT JOIN cscart_products_categories AS product_position_source ON cscart_products_categories.product_id = product_position_source.product_id 
  AND product_position_source.category_id = 22 
WHERE 
  cscart_products_categories.product_id IN (
    95595, 95594, 95593, 95592, 95591, 95590, 
    95589, 95588, 95587, 95586, 95585, 
    95584, 95583, 95582, 95581, 95580, 
    95579, 95578, 95577, 95576, 95575, 
    95574, 95573, 95572, 95571, 94905, 
    95440, 95439, 94679, 94678, 94677, 
    94676, 94675, 94674, 94673, 94672, 
    94659, 94629, 94628, 94626
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00086

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 41 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
1 SIMPLE product_position_source eq_ref PRIMARY,pt PRIMARY 6 const,toolboxdigitalshop_dev.cscart_products_categories.product_id 1

Result

product_id category_ids position
94626 32,22M 0
94628 22M 0
94629 22M 0
94659 22M 0
94672 22M 0
94673 22M 0
94674 22M 0
94675 22M 0
94676 22M 0
94677 22M 0
94678 22M 0
94679 22M 0
94905 22M 0
95439 22M 0
95440 22M 0
95571 22M 0
95572 22M 0
95573 22M 0
95574 22M 0
95575 22M 0
95576 22M 0
95577 22M 0
95578 22M 0
95579 22M 0
95580 22M 0
95581 22M 0
95582 22M 0
95583 22M 0
95584 22M 0
95585 22M 0
95586 22M 0
95587 22M 0
95588 22M 0
95589 22M 0
95590 22M 0
95591 22M 0
95592 22M 0
95593 22M 0
95594 22M 0
95595 22M 0