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 = 7272 
WHERE 
  cscart_products_categories.product_id IN (
    94907, 94916, 94917, 94919, 94920, 94945, 
    94946, 96250, 96251, 96260, 96261, 
    96263, 96264, 96290, 96291, 96576, 
    96581, 96598, 96599, 100550, 100559, 
    100560, 100562, 100563, 100589, 100590, 
    101579, 101580, 101589, 101590, 101592, 
    101593, 101619, 101620, 101624
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00072

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "31.77"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 35,
            "rows_produced_per_join": 35,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "3.77",
              "eval_cost": "3.50",
              "prefix_cost": "7.27",
              "data_read_per_join": "560"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (94907,94916,94917,94919,94920,94945,94946,96250,96251,96260,96261,96263,96264,96290,96291,96576,96581,96598,96599,100550,100559,100560,100562,100563,100589,100590,101579,101580,101589,101590,101592,101593,101619,101620,101624))"
          }
        },
        {
          "table": {
            "table_name": "product_position_source",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "product_id"
            ],
            "key_length": "6",
            "ref": [
              "const",
              "nuie_scalesta_net.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 35,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "8.75",
              "eval_cost": "3.50",
              "prefix_cost": "19.52",
              "data_read_per_join": "560"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "nuie_scalesta_net.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "8.75",
              "eval_cost": "0.18",
              "prefix_cost": "31.77",
              "data_read_per_join": "4K"
            },
            "used_columns": [
              "category_id",
              "usergroup_ids",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`nuie_scalesta_net`.`cscart_categories`.`storefront_id` in (0,1)) and ((`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`))) and (`nuie_scalesta_net`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
94907 7272M 0
94916 7272M 0
94917 7272M 0
94919 7272M 0
94920 7272M 0
94945 7272M 0
94946 7272M 0
96250 7272M 0
96251 7272M 0
96260 7272M 0
96261 7272M 0
96263 7272M 0
96264 7272M 0
96290 7272M 0
96291 7272M 0
96576 7272M 0
96581 7272M 0
96598 7272M 0
96599 7272M 0
100550 7272M 0
100559 7272M 0
100560 7272M 0
100562 7272M 0
100563 7272M 0
100589 7272M 0
100590 7272M 0
101579 7272M 0
101580 7272M 0
101589 7272M 0
101590 7272M 0
101592 7272M 0
101593 7272M 0
101619 7272M 0
101620 7272M 0
101624 7272M 0