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 = 7144 
WHERE 
  cscart_products_categories.product_id IN (
    98742, 98743, 98744, 98745, 98746, 98747, 
    98748, 98749, 99570, 99571, 99572, 
    99573, 99580, 99581, 99582, 99583, 
    99584, 99585, 99586, 99587, 100067, 
    100068, 100069, 100070, 100071, 100072, 
    100150, 100151, 100152, 100153, 100154, 
    100155, 100156, 100169, 100170, 100171, 
    100172, 100173, 100174, 100175, 100176, 
    100177, 100178, 100179, 100180, 100321, 
    100322, 100323, 100324, 100325, 100326, 
    100602, 100603, 100604, 100605, 100606, 
    100607, 100608, 100609, 100610, 100611, 
    100654, 100655, 100656, 100657, 100658, 
    100696, 100697, 100698, 100699, 100884, 
    100885, 100886, 100887, 100900, 100901, 
    100902, 100903, 100904, 100907, 100908, 
    100909, 100910, 100913, 100914, 100915, 
    100916, 100917, 100918, 100919, 100920, 
    100921, 100922, 101112, 101113, 101114
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00702

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "86.69"
    },
    "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": 96,
            "rows_produced_per_join": 96,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "9.89",
              "eval_cost": "9.60",
              "prefix_cost": "19.49",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (98742,98743,98744,98745,98746,98747,98748,98749,99570,99571,99572,99573,99580,99581,99582,99583,99584,99585,99586,99587,100067,100068,100069,100070,100071,100072,100150,100151,100152,100153,100154,100155,100156,100169,100170,100171,100172,100173,100174,100175,100176,100177,100178,100179,100180,100321,100322,100323,100324,100325,100326,100602,100603,100604,100605,100606,100607,100608,100609,100610,100611,100654,100655,100656,100657,100658,100696,100697,100698,100699,100884,100885,100886,100887,100900,100901,100902,100903,100904,100907,100908,100909,100910,100913,100914,100915,100916,100917,100918,100919,100920,100921,100922,101112,101113,101114))"
          }
        },
        {
          "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": 96,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "24.00",
              "eval_cost": "9.60",
              "prefix_cost": "53.09",
              "data_read_per_join": "1K"
            },
            "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": 4,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "24.00",
              "eval_cost": "0.48",
              "prefix_cost": "86.69",
              "data_read_per_join": "12K"
            },
            "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
98742 7147M
98743 7145M
98744 7146M
98745 7145M
98746 7147M
98747 7145M
98748 7146M
98749 7145M
99570 7146M
99571 7145M
99572 7145M
99573 7147M
99580 7145M
99581 7146M
99582 7145M
99583 7147M
99584 7145M
99585 7146M
99586 7145M
99587 7147M
100067 7145M
100068 7146M
100069 7145M
100070 7147M
100071 7146M
100072 7145M
100150 7189M
100151 7146M
100152 7145M
100153 7145M
100154 7147M
100155 7146M
100156 7145M
100169 7145M
100170 7147M
100171 7145M
100172 7147M
100173 7145M
100174 7147M
100175 7146M
100176 7145M
100177 7146M
100178 7145M
100179 7146M
100180 7145M
100321 7145M
100322 7146M
100323 7145M
100324 7147M
100325 7146M
100326 7145M
100602 7146M
100603 7146M
100604 7146M
100605 7145M
100606 7145M
100607 7147M
100608 7146M
100609 7146M
100610 7145M
100611 7146M
100654 7189M
100655 7189M
100656 7189M
100657 7189M
100658 7189M
100696 7146M
100697 7146M
100698 7146M
100699 7146M
100884 7145M
100885 7147M
100886 7146M
100887 7145M
100900 7145M
100901 7147M
100902 7146M
100903 7145M
100904 7189M
100907 7145M
100908 7147M
100909 7146M
100910 7145M
100913 7145M
100914 7147M
100915 7146M
100916 7145M
100917 7146M
100918 7145M
100919 7145M
100920 7147M
100921 7146M
100922 7145M
101112 7145M
101113 7147M
101114 7146M