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 = 7197 
WHERE 
  cscart_products_categories.product_id IN (
    99136, 99137, 99138, 99139, 99140, 99145, 
    99146, 99147, 99148, 99149, 99150, 
    99153, 99154, 99155, 99156, 99157, 
    99158, 99159, 99160, 99161, 99167, 
    99181, 99185, 99186, 99187, 99188, 
    99195, 99196, 99201, 99202, 99205, 
    99210, 99211, 99212, 99213, 99214, 
    99215, 99216, 99217, 99220, 99234, 
    99235, 99236, 99237, 99238, 99240, 
    99241, 99264, 99265, 99266, 99267, 
    99268, 99269, 100386, 100387, 100393, 
    100394, 100434
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01588

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "64.18"
    },
    "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": 71,
            "rows_produced_per_join": 71,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "7.39",
              "eval_cost": "7.10",
              "prefix_cost": "14.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 (99136,99137,99138,99139,99140,99145,99146,99147,99148,99149,99150,99153,99154,99155,99156,99157,99158,99159,99160,99161,99167,99181,99185,99186,99187,99188,99195,99196,99201,99202,99205,99210,99211,99212,99213,99214,99215,99216,99217,99220,99234,99235,99236,99237,99238,99240,99241,99264,99265,99266,99267,99268,99269,100386,100387,100393,100394,100434))"
          }
        },
        {
          "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": 71,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "17.75",
              "eval_cost": "7.10",
              "prefix_cost": "39.34",
              "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": 3,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "17.75",
              "eval_cost": "0.36",
              "prefix_cost": "64.19",
              "data_read_per_join": "9K"
            },
            "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
99136 7199M
99137 7209M
99138 7209M
99139 7203M
99140 7203M
99145 7199M
99146 7209M
99147 7209M
99148 7203M
99149 7203M
99150 7203M
99153 7199M
99154 7199M
99155 7209M
99156 7203M
99157 7203M
99158 7199M
99159 7203M
99160 7203M
99161 7203M
99167 7199M
99181 7199M
99185 7199M
99186 7209M
99187 7199M
99188 7209M
99195 7209M
99196 7203M
99201 7203M
99202 7199M
99205 7199M
99210 7203M
99211 7203M
99212 7199M
99213 7255M
99214 7256M,7262
99215 7256M,7262
99216 7264M
99217 7209M
99220 7199M
99234 7262,7256M
99235 7262,7256M
99236 7256M,7262
99237 7262,7256M
99238 7256M,7262
99240 7256M,7262
99241 7209M
99264 7256M,7262
99265 7256M,7262
99266 7256M,7262
99267 7209M
99268 7262,7256M
99269 7256M,7262
100386 7199M
100387 7199M
100393 7209M
100394 7209M
100434 7199M