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 = 7209 
WHERE 
  cscart_products_categories.product_id IN (
    91061, 88063, 91063, 91062, 91057, 91060, 
    91055, 91058, 91056, 91059, 84848, 
    84912, 87976, 87967, 84910, 87982, 
    87977, 88089, 87968, 88039, 91064, 
    88016, 93151, 93152, 93153, 93155, 
    93157, 93796, 94810, 94825, 95312, 
    95313, 95737, 95755, 95765, 95787, 
    95820, 98230, 98231, 98232, 98324, 
    98326, 98502, 99137, 99138, 99146, 
    99147, 99155, 99186, 99188, 99195, 
    99217, 99241, 99267, 100393, 100394
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00220

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "50.68"
    },
    "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": 56,
            "rows_produced_per_join": 56,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "5.88",
              "eval_cost": "5.60",
              "prefix_cost": "11.48",
              "data_read_per_join": "896"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (91061,88063,91063,91062,91057,91060,91055,91058,91056,91059,84848,84912,87976,87967,84910,87982,87977,88089,87968,88039,91064,88016,93151,93152,93153,93155,93157,93796,94810,94825,95312,95313,95737,95755,95765,95787,95820,98230,98231,98232,98324,98326,98502,99137,99138,99146,99147,99155,99186,99188,99195,99217,99241,99267,100393,100394))"
          }
        },
        {
          "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": 56,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "14.00",
              "eval_cost": "5.60",
              "prefix_cost": "31.08",
              "data_read_per_join": "896"
            },
            "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": 2,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "14.00",
              "eval_cost": "0.28",
              "prefix_cost": "50.68",
              "data_read_per_join": "7K"
            },
            "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
84848 7209M 0
84910 7209M 0
84912 7209M 0
87967 7209M 0
87968 7209M 0
87976 7209M 0
87977 7209M 0
87982 7209M 0
88016 7209M 0
88039 7209M 0
88063 7209M 0
88089 7209M 0
91055 7209M 0
91056 7209M 0
91057 7209M 0
91058 7209M 0
91059 7209M 0
91060 7209M 0
91061 7209M 0
91062 7209M 0
91063 7209M 0
91064 7209M 0
93151 7209M 0
93152 7209M 0
93153 7209M 0
93155 7209M 0
93157 7209M 0
93796 7209M 0
94810 7209M 0
94825 7209M 0
95312 7209M 0
95313 7209M 0
95737 7209M 0
95755 7209M 0
95765 7209M 0
95787 7209M 0
95820 7209M 0
98230 7209M 0
98231 7209M 0
98232 7209M 0
98324 7209M 0
98326 7209M 0
98502 7209M 0
99137 7209M 0
99138 7209M 0
99146 7209M 0
99147 7209M 0
99155 7209M 0
99186 7209M 0
99188 7209M 0
99195 7209M 0
99217 7209M 0
99241 7209M 0
99267 7209M 0
100393 7209M 0
100394 7209M 0