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.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 = 2678 
WHERE 
  cscart_products_categories.product_id IN (
    9126, 23377, 23652, 10370, 23378, 9766, 
    38916, 65059, 26052, 9767, 23380, 23383, 
    37030, 38919, 68325, 26053, 8969, 11174, 
    23379, 37060, 17399, 23381, 36362, 
    36464
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00109

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "47.68"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt",
              "idx_product_category_lookup",
              "idx_products_categories_composite"
            ],
            "key": "idx_products_categories_composite",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 34,
            "rows_produced_per_join": 34,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "3.87",
              "eval_cost": "3.40",
              "prefix_cost": "7.27",
              "data_read_per_join": "544"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (9126,23377,23652,10370,23378,9766,38916,65059,26052,9767,23380,23383,37030,38919,68325,26053,8969,11174,23379,37060,17399,23381,36362,36464))"
          }
        },
        {
          "table": {
            "table_name": "product_position_source",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "pt",
              "idx_product_category_lookup",
              "idx_products_categories_composite"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "product_id"
            ],
            "key_length": "6",
            "ref": [
              "const",
              "cscart_db.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 34,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "25.12",
              "eval_cost": "3.40",
              "prefix_cost": "35.79",
              "data_read_per_join": "544"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "p_category_id",
              "idx_categories_storefront_status",
              "idx_categories_usergroup_status",
              "idx_categories_status_id_path"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "cscart_db.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 27,
            "filtered": "81.96",
            "cost_info": {
              "read_cost": "8.50",
              "eval_cost": "2.79",
              "prefix_cost": "47.69",
              "data_read_per_join": "77K"
            },
            "used_columns": [
              "category_id",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`cscart_db`.`cscart_categories`.`storefront_id` in (0,1)) and (`cscart_db`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
8969 2682M,2684
9126 2682M
9766 2682M
9767 2679M
10370 2682M
11174 2681M
17399 2682M
23377 2682M,2684
23378 2682M,2684
23379 2682M,2684
23380 2682M,2684
23381 2682M,2684
23383 2682M,2684
23652 2669,2682M
26052 2669,2682M
26053 2669,2682M
36362 2682M
36464 2682M
37030 2682M
37060 2682M
38916 2682M
38919 2682M
65059 2682M
68325 2681M