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 = 7143 
WHERE 
  cscart_products_categories.product_id IN (
    100909, 100910, 100913, 100914, 100915, 
    100916, 100917, 100918, 100919, 100920, 
    100921, 100922, 101105, 101106, 101112, 
    101113, 101114, 101115, 101121, 101122, 
    101123, 101124, 101130, 101131, 101132, 
    101133, 101514, 101515, 101516, 101517, 
    101523, 101524, 101525, 101526, 101532, 
    101533, 101534, 101535, 101552, 101553, 
    101554, 101555, 101561, 101562, 101563, 
    101564, 101570, 101571, 101572, 101573, 
    101635, 101636, 101639, 101640, 101641, 
    101642, 101643, 101644, 101645, 101646, 
    101647, 101648, 101649, 101650, 101651, 
    101652, 101653, 101814, 101815, 101816, 
    101817, 101818, 101819, 101820, 101821, 
    101822, 101823, 101824, 101825, 101826, 
    101827, 101828, 101829, 101830, 101831, 
    101832, 101833, 101834, 101835, 101836, 
    101837, 101838, 101839, 101840, 101841, 
    101842
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01668

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "99.30"
    },
    "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": 110,
            "rows_produced_per_join": 110,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "11.30",
              "eval_cost": "11.00",
              "prefix_cost": "22.30",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (100909,100910,100913,100914,100915,100916,100917,100918,100919,100920,100921,100922,101105,101106,101112,101113,101114,101115,101121,101122,101123,101124,101130,101131,101132,101133,101514,101515,101516,101517,101523,101524,101525,101526,101532,101533,101534,101535,101552,101553,101554,101555,101561,101562,101563,101564,101570,101571,101572,101573,101635,101636,101639,101640,101641,101642,101643,101644,101645,101646,101647,101648,101649,101650,101651,101652,101653,101814,101815,101816,101817,101818,101819,101820,101821,101822,101823,101824,101825,101826,101827,101828,101829,101830,101831,101832,101833,101834,101835,101836,101837,101838,101839,101840,101841,101842))"
          }
        },
        {
          "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": 110,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "27.50",
              "eval_cost": "11.00",
              "prefix_cost": "60.80",
              "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": 5,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "27.50",
              "eval_cost": "0.55",
              "prefix_cost": "99.30",
              "data_read_per_join": "14K"
            },
            "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
100909 7146M
100910 7145M
100913 7145M
100914 7147M
100915 7146M
100916 7145M
100917 7146M
100918 7145M
100919 7145M
100920 7147M
100921 7146M
100922 7145M
101105 7326M
101106 7326M
101112 7145M
101113 7147M
101114 7146M
101115 7145M
101121 7145M
101122 7147M
101123 7146M
101124 7145M
101130 7145M
101131 7147M
101132 7146M
101133 7145M
101514 7145M
101515 7147M
101516 7146M
101517 7145M
101523 7145M
101524 7147M
101525 7146M
101526 7145M
101532 7145M
101533 7147M
101534 7146M
101535 7145M
101552 7145M
101553 7147M
101554 7146M
101555 7145M
101561 7145M
101562 7147M
101563 7146M
101564 7145M
101570 7145M
101571 7147M
101572 7146M
101573 7145M
101635 7151M,7301
101636 7151M,7301
101639 7151M,7301
101640 7151M,7301
101641 7302M
101642 7302M
101643 7302M
101644 7151M,7301
101645 7151M,7301
101646 7151M,7301
101647 7151M,7301
101648 7151M,7301
101649 7151M,7301
101650 7151M,7301
101651 7151M,7301
101652 7151M,7301
101653 7151M,7301
101814 7146M
101815 7146M
101816 7146M
101817 7146M
101818 7146M
101819 7146M
101820 7146M
101821 7146M
101822 7146M
101823 7146M
101824 7145M
101825 7145M
101826 7145M
101827 7145M
101828 7145M
101829 7145M
101830 7145M
101831 7145M
101832 7145M
101833 7145M
101834 7146M
101835 7146M
101836 7146M
101837 7146M
101838 7146M
101839 7146M
101840 7146M
101841 7146M
101842 7146M