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 = 7230 
WHERE 
  cscart_products_categories.product_id IN (
    96064, 96065, 96066, 96067, 96068, 96069, 
    96070, 96071, 96072, 96073, 96074, 
    96075, 96076, 96077, 96078, 96079, 
    96080, 96081, 96082, 96083, 96084, 
    96085, 96086, 96087, 96088, 96089, 
    96090, 96091, 96092, 96093, 96094, 
    96095, 96096, 96097, 96098, 96099, 
    96100, 96101, 96102, 96103, 96104, 
    96383, 96384, 96385, 96386, 96387, 
    96388, 96389, 96390, 96391, 96394, 
    96395, 96396, 96397, 96398, 96399, 
    96400, 96409, 96410, 96429, 96432, 
    96433, 96442, 96443, 96444, 96445, 
    96446, 96447, 96448, 96449, 96450, 
    96451, 96452, 96453, 96454, 96455, 
    96456, 96457, 96458, 96459, 96460, 
    96461, 96462, 96463, 96464, 96465, 
    96466, 96467, 96468, 96469, 96470, 
    96471, 96472, 96473, 96474, 98600
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01773

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 (96064,96065,96066,96067,96068,96069,96070,96071,96072,96073,96074,96075,96076,96077,96078,96079,96080,96081,96082,96083,96084,96085,96086,96087,96088,96089,96090,96091,96092,96093,96094,96095,96096,96097,96098,96099,96100,96101,96102,96103,96104,96383,96384,96385,96386,96387,96388,96389,96390,96391,96394,96395,96396,96397,96398,96399,96400,96409,96410,96429,96432,96433,96442,96443,96444,96445,96446,96447,96448,96449,96450,96451,96452,96453,96454,96455,96456,96457,96458,96459,96460,96461,96462,96463,96464,96465,96466,96467,96468,96469,96470,96471,96472,96473,96474,98600))"
          }
        },
        {
          "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
96064 7231M
96065 7234M
96066 7231M
96067 7234M
96068 7231M
96069 7234M
96070 7231M
96071 7234M
96072 7231M
96073 7234M
96074 7231M
96075 7234M
96076 7231M
96077 7234M
96078 7231M
96079 7234M
96080 7234M
96081 7234M
96082 7231M
96083 7231M
96084 7234M
96085 7234M
96086 7231M
96087 7231M
96088 7234M
96089 7234M
96090 7231M
96091 7231M
96092 7234M
96093 7234M
96094 7231M
96095 7231M
96096 7234M
96097 7234M
96098 7231M
96099 7231M
96100 7234M
96101 7234M
96102 7231M
96103 7231M
96104 7234M
96383 7231M
96384 7231M
96385 7231M
96386 7231M
96387 7231M
96388 7231M
96389 7231M
96390 7231M
96391 7231M
96394 7234M
96395 7234M
96396 7234M
96397 7234M
96398 7231M
96399 7231M
96400 7231M
96409 7234M
96410 7234M
96429 7234M
96432 7234M
96433 7234M
96442 7234M
96443 7234M
96444 7234M
96445 7234M
96446 7234M
96447 7234M
96448 7234M
96449 7234M
96450 7234M
96451 7234M
96452 7234M
96453 7234M
96454 7234M
96455 7234M
96456 7234M
96457 7234M
96458 7234M
96459 7234M
96460 7234M
96461 7234M
96462 7234M
96463 7234M
96464 7234M
96465 7234M
96466 7234M
96467 7234M
96468 7234M
96469 7234M
96470 7234M
96471 7234M
96472 7234M
96473 7234M
96474 7234M
98600 7231M