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 = 7147 
WHERE 
  cscart_products_categories.product_id IN (
    91905, 91906, 91907, 91908, 91909, 91910, 
    91911, 84268, 89735, 91904, 89435, 
    82417, 86852, 89433, 82399, 86848, 
    84265, 89731, 89431, 83088, 89124, 
    89128, 89160, 89551, 91290, 82332, 
    86814, 86844, 89101, 91286, 90093, 
    90103, 90112, 83115, 83125, 83134, 
    90120, 89199, 83142, 91282, 84121, 
    89202, 83145, 84124, 92841, 94077, 
    94689, 94713, 96714, 96755, 96770, 
    97014, 97019, 97035, 97042, 97048, 
    97054, 97813, 97837, 97991, 98033, 
    98157, 98161, 98165, 98700, 98738, 
    98742, 98746, 99573, 99583, 99587, 
    100070, 100154, 100170, 100172, 100174, 
    100324, 100607, 100885, 100901, 100908, 
    100914, 100920, 101113, 101122, 101131, 
    101515, 101524, 101533, 101553, 101562, 
    101571
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01844

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "101.10"
    },
    "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": 112,
            "rows_produced_per_join": 112,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "11.50",
              "eval_cost": "11.20",
              "prefix_cost": "22.70",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (91905,91906,91907,91908,91909,91910,91911,84268,89735,91904,89435,82417,86852,89433,82399,86848,84265,89731,89431,83088,89124,89128,89160,89551,91290,82332,86814,86844,89101,91286,90093,90103,90112,83115,83125,83134,90120,89199,83142,91282,84121,89202,83145,84124,92841,94077,94689,94713,96714,96755,96770,97014,97019,97035,97042,97048,97054,97813,97837,97991,98033,98157,98161,98165,98700,98738,98742,98746,99573,99583,99587,100070,100154,100170,100172,100174,100324,100607,100885,100901,100908,100914,100920,101113,101122,101131,101515,101524,101533,101553,101562,101571))"
          }
        },
        {
          "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": 112,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "28.00",
              "eval_cost": "11.20",
              "prefix_cost": "61.90",
              "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": 5,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "28.00",
              "eval_cost": "0.56",
              "prefix_cost": "101.10",
              "data_read_per_join": "14K"
            },
            "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
82332 7147M 0
82399 7147M 0
82417 7147M 0
83088 7147M 0
83115 7147M 0
83125 7147M 0
83134 7147M 0
83142 7147M 0
83145 7147M 0
84121 7147M 0
84124 7147M 0
84265 7147M 0
84268 7143,7144,7147M 0
86814 7147M 0
86844 7147M 0
86848 7147M 0
86852 7147M 0
89101 7147M 0
89124 7147M 0
89128 7147M 0
89160 7147M 0
89199 7147M 0
89202 7147M 0
89431 7147M 0
89433 7147M 0
89435 7147M 0
89551 7147M 0
89731 7147M 0
89735 7143,7144,7147M 0
90093 7147M 0
90103 7147M 0
90112 7147M 0
90120 7147M 0
91282 7147M 0
91286 7147M 0
91290 7147M 0
91904 7143M,7144,7147 0
91905 7143M,7144,7147 0
91906 7143M,7144,7147 0
91907 7143M,7144,7147 0
91908 7143M,7144,7147 0
91909 7143M,7144,7147 0
91910 7143M,7144,7147 0
91911 7143M,7144,7147 0
92841 7147M 0
94077 7147M 0
94689 7147M 0
94713 7147M 0
96714 7147M 0
96755 7147M 0
96770 7147M 0
97014 7147M 0
97019 7147M 0
97035 7147M 0
97042 7147M 0
97048 7147M 0
97054 7147M 0
97813 7147M 0
97837 7147M 0
97991 7147M 0
98033 7147M 0
98157 7147M 0
98161 7147M 0
98165 7147M 0
98700 7147M 0
98738 7147M 0
98742 7147M 0
98746 7147M 0
99573 7147M 0
99583 7147M 0
99587 7147M 0
100070 7147M 0
100154 7147M 0
100170 7147M 0
100172 7147M 0
100174 7147M 0
100324 7147M 0
100607 7147M 0
100885 7147M 0
100901 7147M 0
100908 7147M 0
100914 7147M 0
100920 7147M 0
101113 7147M 0
101122 7147M 0
101131 7147M 0
101515 7147M 0
101524 7147M 0
101533 7147M 0
101553 7147M 0
101562 7147M 0
101571 7147M 0