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 = 7201 
WHERE 
  cscart_products_categories.product_id IN (
    93532, 93819, 93820, 93821, 93822, 93823, 
    93824, 93831, 93846, 93847, 93855, 
    93856, 93857, 93858, 93878, 93879, 
    93880, 93881, 94161, 94162, 94163, 
    94164, 94435, 94442, 94443, 94444, 
    94445, 94446, 94592, 94593, 94594, 
    94650, 94662, 94814, 94815, 94837, 
    95443, 95444, 95445, 95446, 95447, 
    95791, 95792, 95793, 95794, 95795, 
    95796, 95797, 95798, 95799, 95800, 
    95801, 95802, 95804, 95806, 95808, 
    95810, 95812, 96564, 96565, 96566, 
    96567, 96568, 97716, 97717, 97718, 
    97774, 97786, 98146, 98148, 98152, 
    98155, 98407, 98408, 98409, 98410, 
    98552, 98553, 98554, 98555, 98556, 
    98763, 98764, 98765, 98766, 98767, 
    98768, 98818, 98822, 98826, 98830, 
    98859, 98860, 98861, 98862, 98863
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00248

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "54.77"
    },
    "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 (93532,93819,93820,93821,93822,93823,93824,93831,93846,93847,93855,93856,93857,93858,93878,93879,93880,93881,94161,94162,94163,94164,94435,94442,94443,94444,94445,94446,94592,94593,94594,94650,94662,94814,94815,94837,95443,95444,95445,95446,95447,95791,95792,95793,95794,95795,95796,95797,95798,95799,95800,95801,95802,95804,95806,95808,95810,95812,96564,96565,96566,96567,96568,97716,97717,97718,97774,97786,98146,98148,98152,98155,98407,98408,98409,98410,98552,98553,98554,98555,98556,98763,98764,98765,98766,98767,98768,98818,98822,98826,98830,98859,98860,98861,98862,98863))"
          }
        },
        {
          "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": "53.09",
              "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')))"
          }
        },
        {
          "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": 4,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.20",
              "eval_cost": "0.48",
              "prefix_cost": "54.77",
              "data_read_per_join": "76"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
93532 7201M 0
93819 7201M 0
93820 7201M 0
93821 7201M 0
93822 7201M 0
93823 7201M 0
93824 7201M 0
93831 7201M 0
93846 7201M 0
93847 7201M 0
93855 7201M 0
93856 7201M 0
93857 7201M 0
93858 7201M 0
93878 7201M 0
93879 7201M 0
93880 7201M 0
93881 7201M 0
94161 7201M 0
94162 7201M 0
94163 7201M 0
94164 7201M 0
94435 7201M 0
94442 7201M 0
94443 7201M 0
94444 7201M 0
94445 7201M 0
94446 7201M 0
94592 7201M 0
94593 7201M 0
94594 7201M 0
94650 7201M 0
94662 7201M 0
94814 7201M 0
94815 7201M 0
94837 7201M 0
95443 7201M 0
95444 7201M 0
95445 7201M 0
95446 7201M 0
95447 7201M 0
95791 7201M 0
95792 7201M 0
95793 7201M 0
95794 7201M 0
95795 7201M 0
95796 7201M 0
95797 7201M 0
95798 7201M 0
95799 7201M 0
95800 7201M 0
95801 7201M 0
95802 7201M 0
95804 7201M 0
95806 7201M 0
95808 7201M 0
95810 7201M 0
95812 7201M 0
96564 7201M 0
96565 7201M 0
96566 7201M 0
96567 7201M 0
96568 7201M 0
97716 7201M 0
97717 7201M 0
97718 7201M 0
97774 7201M 0
97786 7201M 0
98146 7201M 0
98148 7201M 0
98152 7201M 0
98155 7201M 0
98407 7201M 0
98408 7201M 0
98409 7201M 0
98410 7201M 0
98552 7201M 0
98553 7201M 0
98554 7201M 0
98555 7201M 0
98556 7201M 0
98763 7201M 0
98764 7201M 0
98765 7201M 0
98766 7201M 0
98767 7201M 0
98768 7201M 0
98818 7201M 0
98822 7201M 0
98826 7201M 0
98830 7201M 0
98859 7201M 0
98860 7201M 0
98861 7201M 0
98862 7201M 0
98863 7201M 0