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 = 7326 
WHERE 
  cscart_products_categories.product_id IN (
    82420, 82354, 82421, 82381, 89334, 89336, 
    82355, 82380, 89333, 86823, 89335, 
    89370, 89372, 89273, 89276, 89369, 
    89371, 89374, 86819, 86821, 89272, 
    89275, 89271, 89274, 86822, 89327, 
    89373, 89266, 89328, 89329, 89269, 
    89331, 89265, 89330, 89264, 86817, 
    89368, 89268, 89367, 89308, 89267, 
    86818, 86820, 89332, 89309, 89321, 
    89323, 89322, 89325, 86816, 89306, 
    89324, 89366, 89305, 89317, 89307, 
    89319, 89326, 89312, 89318, 89314, 
    89320, 89315, 89313, 89316, 89310, 
    89311, 89304, 89303, 93071, 93072, 
    93073, 93074, 93075, 93076, 93077, 
    93515, 93516, 93517, 93518, 93519, 
    93520, 93521, 93522, 93894, 93895, 
    94067, 94068, 94069, 94070, 94071, 
    94072, 94703, 94704, 96296, 96297
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01997

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 (82420,82354,82421,82381,89334,89336,82355,82380,89333,86823,89335,89370,89372,89273,89276,89369,89371,89374,86819,86821,89272,89275,89271,89274,86822,89327,89373,89266,89328,89329,89269,89331,89265,89330,89264,86817,89368,89268,89367,89308,89267,86818,86820,89332,89309,89321,89323,89322,89325,86816,89306,89324,89366,89305,89317,89307,89319,89326,89312,89318,89314,89320,89315,89313,89316,89310,89311,89304,89303,93071,93072,93073,93074,93075,93076,93077,93515,93516,93517,93518,93519,93520,93521,93522,93894,93895,94067,94068,94069,94070,94071,94072,94703,94704,96296,96297))"
          }
        },
        {
          "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
82354 7326M 0
82355 7326M 0
82380 7326M 0
82381 7326M 0
82420 7326M 0
82421 7326M 0
86816 7326M 0
86817 7326M 0
86818 7326M 0
86819 7326M 0
86820 7326M 0
86821 7326M 0
86822 7326M 0
86823 7326M 0
89264 7326M 0
89265 7326M 0
89266 7326M 0
89267 7326M 0
89268 7326M 0
89269 7326M 0
89271 7326M 0
89272 7326M 0
89273 7326M 0
89274 7326M 0
89275 7326M 0
89276 7326M 0
89303 7326M 0
89304 7326M 0
89305 7326M 0
89306 7326M 0
89307 7326M 0
89308 7326M 0
89309 7326M 0
89310 7326M 0
89311 7326M 0
89312 7326M 0
89313 7326M 0
89314 7326M 0
89315 7326M 0
89316 7326M 0
89317 7326M 0
89318 7326M 0
89319 7326M 0
89320 7326M 0
89321 7326M 0
89322 7326M 0
89323 7326M 0
89324 7326M 0
89325 7326M 0
89326 7326M 0
89327 7326M 0
89328 7326M 0
89329 7326M 0
89330 7326M 0
89331 7326M 0
89332 7326M 0
89333 7326M 0
89334 7326M 0
89335 7326M 0
89336 7326M 0
89366 7326M 0
89367 7326M 0
89368 7326M 0
89369 7326M 0
89370 7326M 0
89371 7326M 0
89372 7326M 0
89373 7326M 0
89374 7326M 0
93071 7326M 0
93072 7326M 0
93073 7326M 0
93074 7326M 0
93075 7326M 0
93076 7326M 0
93077 7326M 0
93515 7326M 0
93516 7326M 0
93517 7326M 0
93518 7326M 0
93519 7326M 0
93520 7326M 0
93521 7326M 0
93522 7326M 0
93894 7326M 0
93895 7326M 0
94067 7326M 0
94068 7326M 0
94069 7326M 0
94070 7326M 0
94071 7326M 0
94072 7326M 0
94703 7326M 0
94704 7326M 0
96296 7326M 0
96297 7326M 0