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 = 7210 
WHERE 
  cscart_products_categories.product_id IN (
    88025, 84696, 88938, 87996, 88549, 89018, 
    84699, 88516, 88519, 89109, 89116, 
    89784, 88073, 88195, 88207, 88768, 
    88940, 88449, 88466, 88482, 88040, 
    88690, 88737, 84703, 84706, 88082, 
    91053, 87616, 87624, 90815, 88941, 
    89102, 89108, 89110, 89115, 87958, 
    88068, 88675, 88722, 87951, 88067, 
    88512, 88548, 88590, 88591, 88592, 
    90834, 88447, 88464, 88480, 88691, 
    88738, 87548, 88077, 88141, 88144, 
    88767, 90829, 89574, 88939, 89017, 
    88547, 87986, 87946, 88583, 88674, 
    88721, 87947, 87949, 88043, 88582, 
    90833, 87956, 89982, 89983, 89984, 
    88081, 87620, 87622, 84702, 84705, 
    91052, 88003, 88545, 88046, 88080, 
    88403, 84697, 84698, 88028, 88140, 
    88143, 88508, 88543, 88765, 89016
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01716

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "136.24"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "10.73"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "ALL",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "rows_examined_per_scan": 208,
            "rows_produced_per_join": 8,
            "filtered": "4.00",
            "cost_info": {
              "read_cost": "20.72",
              "eval_cost": "0.83",
              "prefix_cost": "21.55",
              "data_read_per_join": "21K"
            },
            "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')))"
          }
        },
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "nuie_scalesta_net.cscart_categories.category_id"
            ],
            "rows_examined_per_scan": 117,
            "rows_produced_per_join": 10,
            "filtered": "1.10",
            "cost_info": {
              "read_cost": "2.33",
              "eval_cost": "1.07",
              "prefix_cost": "121.75",
              "data_read_per_join": "171"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (88025,84696,88938,87996,88549,89018,84699,88516,88519,89109,89116,89784,88073,88195,88207,88768,88940,88449,88466,88482,88040,88690,88737,84703,84706,88082,91053,87616,87624,90815,88941,89102,89108,89110,89115,87958,88068,88675,88722,87951,88067,88512,88548,88590,88591,88592,90834,88447,88464,88480,88691,88738,87548,88077,88141,88144,88767,90829,89574,88939,89017,88547,87986,87946,88583,88674,88721,87947,87949,88043,88582,90833,87956,89982,89983,89984,88081,87620,87622,84702,84705,91052,88003,88545,88046,88080,88403,84697,84698,88028,88140,88143,88508,88543,88765,89016))"
          }
        },
        {
          "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": 10,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.68",
              "eval_cost": "1.07",
              "prefix_cost": "125.51",
              "data_read_per_join": "171"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
84696 7208M,7241,7309,7346
84697 7208M,7241,7309,7346
84698 7208M,7241,7309,7346
84699 7208M,7241,7309,7346
84702 7208M,7241,7309,7346
84703 7208M,7241,7309,7346
84705 7208M,7241,7309,7346
84706 7208M,7241,7309,7346
87548 7210,7211,7214M 0
87616 7210,7211,7212M 0
87620 7210,7211,7212M 0
87622 7210,7211,7212M 0
87624 7210,7211,7212M 0
87946 7258M
87947 7258M
87949 7258M
87951 7258M
87956 7258M
87958 7259M,7345,7347
87986 7258M
87996 7258M
88003 7258M
88025 7258M
88028 7258M
88040 7258M
88043 7258M
88046 7259M,7345,7347
88067 7260M,7320
88068 7260M,7320
88073 7258M
88077 7258M
88080 7258M
88081 7258M
88082 7259M,7345,7347
88140 7208M,7241,7309,7346
88141 7208M,7241,7309,7346
88143 7208M,7241,7309,7346
88144 7208M,7241,7309,7346
88195 7210,7211,7214M 0
88207 7210,7211,7214M 0
88403 7210,7211,7214M 0
88447 7210,7211,7214M 0
88449 7210,7211,7214M 0
88464 7210,7211,7214M 0
88466 7210,7211,7214M 0
88480 7210,7211,7214M 0
88482 7210,7211,7214M 0
88508 7208M,7241,7309,7346
88512 7208M,7241,7309,7346
88516 7208M,7241,7309,7346
88519 7208M,7241,7309,7346
88543 7210,7211,7212M 0
88545 7210,7211,7214M 0
88547 7210,7211,7212M 0
88548 7210,7211,7282M 0
88549 7210,7211,7282M 0
88582 7210,7211,7214M 0
88583 7210,7211,7214M 0
88590 7210,7211,7282M 0
88591 7210,7211,7282M 0
88592 7210,7211,7282M 0
88674 7210,7211,7214M 0
88675 7210,7211,7214M 0
88690 7210,7211,7214M 0
88691 7210,7211,7214M 0
88721 7210,7211,7214M 0
88722 7210,7211,7214M 0
88737 7210,7211,7214M 0
88738 7210,7211,7214M 0
88765 7210,7211,7214M 0
88767 7210,7211,7214M 0
88768 7210,7211,7214M 0
88938 7208M,7241,7309,7346
88939 7208M,7241,7309,7346
88940 7208M,7241,7309,7346
88941 7208M,7241,7309,7346
89016 7210,7211,7212M 0
89017 7210,7211,7212M 0
89018 7210,7211,7212M 0
89102 7210,7211,7212M 0
89108 7210,7211,7214M 0
89109 7210,7211,7214M 0
89110 7210,7211,7212M 0
89115 7210,7211,7214M 0
89116 7210,7211,7214M 0
89574 7210,7240,7241M 0
89784 7210,7211,7212M 0
89982 7259M,7345,7347
89983 7259M,7345,7347
89984 7259M,7345,7347
90815 7210,7211,7212M 0
90829 7210,7211,7212M 0
90833 7210,7211,7214M 0
90834 7210,7211,7214M 0
91052 7208M,7241,7309,7346
91053 7208M,7241,7309,7346