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 (
    89591, 89586, 89585, 89584, 89583, 89121, 
    89120, 89119, 89118, 89117, 89116, 
    89089, 89088, 89087, 89695, 89549, 
    89548, 89547, 89482, 89283, 89097, 
    89096, 89095, 89094, 89093, 89091, 
    89050, 89049, 89048, 89508, 89507, 
    89506, 89505, 89504, 89025, 89024, 
    89023, 89022, 89021, 89020
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00083

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 57 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
89020 33,22M 0
89021 33,22M 0
89022 33,22M 0
89023 33,22M 0
89024 33,22M 0
89025 33,22M 0
89048 22M 0
89049 22M 0
89050 22M 0
89087 22M 0
89088 22M 0
89089 22M 0
89091 22M 0
89093 22M 0
89094 22M 0
89095 22M 0
89096 22M 0
89097 22M 0
89116 34,22M 0
89117 34,22M 0
89118 34,22M 0
89119 34,22M 0
89120 34,22M 0
89121 34,22M 0
89283 22M 0
89482 22M 0
89504 33,22M 0
89505 33,22M 0
89506 33,22M 0
89507 33,22M 0
89508 33,22M 0
89547 22M 0
89548 22M 0
89549 22M 0
89583 22M 0
89584 22M 0
89585 22M 0
89586 22M 0
89591 22M 0
89695 22M 0