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 (
    49614, 49613, 49612, 49611, 49610, 49609, 
    49608, 49607, 49606, 49605, 49604, 
    49603, 49602, 49601, 49556, 49906, 
    49561, 49552, 49551, 49500, 49330, 
    49329, 49499, 49498, 50076, 49497, 
    49459, 49435, 49291, 49290, 49726, 
    49450, 49454, 49453, 49238, 49237, 
    49236, 49407, 49281, 49243, 49242, 
    49241, 49224, 49223, 49348, 49347, 
    49346, 49207, 49190, 49189, 49188, 
    49183, 49182, 49181, 49180, 49179, 
    49178, 49177, 49176, 49175, 49174, 
    49173, 49172, 49171, 49170, 49169, 
    49343, 49304, 49303, 49302, 49282, 
    49165, 49141, 49140, 49139, 49138, 
    49153, 49152, 49151, 49150
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00139

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 85 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
49138 22M 0
49139 22M 0
49140 22M 0
49141 22M 0
49150 33,22M 0
49151 33,22M 0
49152 33,22M 0
49153 33,22M 0
49165 22M 0
49169 22M 0
49170 22M 0
49171 22M 0
49172 22M 0
49173 22M 0
49174 22M 0
49175 22M 0
49176 22M 0
49177 22M 0
49178 22M 0
49179 22M 0
49180 22M 0
49181 22M 0
49182 22M 0
49183 22M 0
49188 22M 0
49189 22M 0
49190 22M 0
49207 22M 0
49223 22M 0
49224 22M 0
49236 22M 0
49237 22M 0
49238 22M 0
49241 22M 0
49242 22M 0
49243 22M 0
49281 22M 0
49282 22M 0
49290 22M 0
49291 22M 0
49302 22M 0
49303 22M 0
49304 22M 0
49329 22M 0
49330 22M 0
49343 22M 0
49346 22M 0
49347 22M 0
49348 22M 0
49407 22M 0
49435 22M 0
49450 22M 0
49453 22M 0
49454 22M 0
49459 22M 0
49497 22M 0
49498 22M 0
49499 22M 0
49500 22M 0
49551 22M 0
49552 22M 0
49556 22M 0
49561 32,22M 0
49601 22M 0
49602 22M 0
49603 22M 0
49604 22M 0
49605 22M 0
49606 22M 0
49607 22M 0
49608 22M 0
49609 22M 0
49610 22M 0
49611 22M 0
49612 22M 0
49613 22M 0
49614 22M 0
49726 22M 0
49906 22M 0
50076 22M 0