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 = 7156 
WHERE 
  cscart_products_categories.product_id IN (
    96207, 96208, 96210, 96211, 96510, 96511, 
    96512, 96513, 96514, 96515, 96516, 
    96517, 96518, 96519, 96520, 96521, 
    96538, 96539, 96540, 96541, 96542, 
    96543, 96544, 96545, 96546, 96547, 
    96548, 96549, 96550, 96551, 96552, 
    96553, 96554, 96555, 96556, 96557, 
    96558, 96601, 96604, 96605, 96607, 
    96609, 96611, 96614, 96615, 96620, 
    96621, 96622
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01514

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "78.59"
    },
    "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": 87,
            "rows_produced_per_join": 87,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "8.99",
              "eval_cost": "8.70",
              "prefix_cost": "17.69",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (96207,96208,96210,96211,96510,96511,96512,96513,96514,96515,96516,96517,96518,96519,96520,96521,96538,96539,96540,96541,96542,96543,96544,96545,96546,96547,96548,96549,96550,96551,96552,96553,96554,96555,96556,96557,96558,96601,96604,96605,96607,96609,96611,96614,96615,96620,96621,96622))"
          }
        },
        {
          "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": 87,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "21.75",
              "eval_cost": "8.70",
              "prefix_cost": "48.14",
              "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": "21.75",
              "eval_cost": "0.44",
              "prefix_cost": "78.59",
              "data_read_per_join": "11K"
            },
            "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
96207 7343,7342,7341,7157M
96208 7157M,7343,7342,7341
96210 7194M
96211 7194M
96510 7194M
96511 7194M
96512 7194M
96513 7194M
96514 7194M
96515 7194M
96516 7194M
96517 7194M
96518 7194M
96519 7194M
96520 7194M
96521 7194M
96538 7194M
96539 7194M
96540 7194M
96541 7194M
96542 7194M
96543 7194M
96544 7194M
96545 7194M
96546 7194M
96547 7194M
96548 7194M
96549 7194M
96550 7194M
96551 7194M
96552 7194M
96553 7194M
96554 7194M
96555 7194M
96556 7194M
96557 7194M
96558 7194M
96601 7342,7157M,7341,7343
96604 7342,7157M,7341,7343
96605 7341,7342,7157M,7343
96607 7342,7341,7157M,7343
96609 7341,7342,7157M,7343
96611 7341,7342,7343,7157M
96614 7341,7342,7157M,7343
96615 7343,7342,7341,7157M
96620 7342,7343,7341,7157M
96621 7157M,7343,7342,7341
96622 7342,7341,7157M,7343