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 = 1 
WHERE 
  cscart_products_categories.product_id IN (
    79485, 79484, 79483, 79482, 79481, 79480, 
    79479, 79473, 79472, 79475, 79474, 
    78864, 79371, 79362, 78850, 78630, 
    79249, 79248, 79247, 79243
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00050

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 22 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
78630 1M 0
78850 28,1M 0
78864 28,1M 0
79243 1M 0
79247 1M 0
79248 1M 0
79249 1M 0
79362 1M 0
79371 1M 0
79472 1M 0
79473 1M 0
79474 1M 0
79475 1M 0
79479 1M 0
79480 1M 0
79481 1M 0
79482 1M 0
79483 1M 0
79484 1M 0
79485 1M 0