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 = 7195 
WHERE 
  cscart_products_categories.product_id IN (
    100858, 100859, 100860, 100861, 100862, 
    100867, 100868, 100869, 100870, 100877, 
    100878, 101055, 101056, 101057, 101058, 
    101059, 101060, 101061, 101062, 101063, 
    101064, 101065, 101066, 101067, 101068, 
    101069, 101070, 101071, 101072, 101073, 
    101074, 101075, 101076, 101077, 101078, 
    101079, 101080, 101081, 101082, 101083, 
    101084, 101085, 101086, 101087, 101088, 
    101089, 101090, 101091
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00158

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "48.88"
    },
    "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": 54,
            "rows_produced_per_join": 54,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "5.68",
              "eval_cost": "5.40",
              "prefix_cost": "11.08",
              "data_read_per_join": "864"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (100858,100859,100860,100861,100862,100867,100868,100869,100870,100877,100878,101055,101056,101057,101058,101059,101060,101061,101062,101063,101064,101065,101066,101067,101068,101069,101070,101071,101072,101073,101074,101075,101076,101077,101078,101079,101080,101081,101082,101083,101084,101085,101086,101087,101088,101089,101090,101091))"
          }
        },
        {
          "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": 54,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "13.50",
              "eval_cost": "5.40",
              "prefix_cost": "29.98",
              "data_read_per_join": "864"
            },
            "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": 2,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "13.50",
              "eval_cost": "0.27",
              "prefix_cost": "48.88",
              "data_read_per_join": "7K"
            },
            "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
100858 7287M
100859 7287M
100860 7287M
100861 7287M
100862 7287M
100867 7330,7285M
100868 7330,7285M
100869 7330,7285M
100870 7330,7285M
100877 7330,7285M
100878 7330,7285M
101055 7254M
101056 7254M
101057 7254M
101058 7254M
101059 7254M
101060 7254M
101061 7254M
101062 7254M
101063 7254M
101064 7254M
101065 7254M
101066 7254M
101067 7254M
101068 7254M
101069 7254M
101070 7254M
101071 7254M
101072 7254M
101073 7254M
101074 7254M
101075 7254M
101076 7254M
101077 7254M
101078 7254M
101079 7254M
101080 7254M
101081 7254M
101082 7254M
101083 7254M
101084 7254M
101085 7254M
101086 7254M
101087 7254M
101088 7254M
101089 7254M
101090 7254M
101091 7254M