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 = 2910 
WHERE 
  cscart_products_categories.product_id IN (
    351612, 352403, 353662, 354659, 354938, 
    356566, 357755, 357764, 359035, 350308, 
    351499, 352647, 356228, 356851, 357797, 
    358556, 350029, 358941, 349836, 350268, 
    350368, 351541, 354515, 354642, 356094, 
    350097, 351045, 351815, 352157, 352170, 
    352364, 353781, 354169, 355537, 356506, 
    356861, 358535, 354658, 354714, 355301, 
    356246, 350306, 350670, 353632, 349939, 
    352530, 353854, 356306, 356544, 358670, 
    350351, 349772, 349890, 350282, 350342, 
    353127, 354261, 354675, 355540, 356392, 
    358292, 349736, 349887, 349943, 350375, 
    353459, 354694, 354873, 359419, 352803, 
    355567, 351312, 354235, 355500, 355793, 
    356645, 349694, 349826, 351595, 354250, 
    354734, 358441, 359053, 352613, 353085, 
    353938, 354120, 354124, 356294, 357584, 
    359116, 353517, 354432, 354541, 356325, 
    356896, 351436, 355573, 358867, 359228
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00237

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "281.15"
    },
    "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": 100,
            "rows_produced_per_join": 100,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "21.15",
              "eval_cost": "20.00",
              "prefix_cost": "41.15",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`webmarco`.`cscart_products_categories`.`product_id` in (351612,352403,353662,354659,354938,356566,357755,357764,359035,350308,351499,352647,356228,356851,357797,358556,350029,358941,349836,350268,350368,351541,354515,354642,356094,350097,351045,351815,352157,352170,352364,353781,354169,355537,356506,356861,358535,354658,354714,355301,356246,350306,350670,353632,349939,352530,353854,356306,356544,358670,350351,349772,349890,350282,350342,353127,354261,354675,355540,356392,358292,349736,349887,349943,350375,353459,354694,354873,359419,352803,355567,351312,354235,355500,355793,356645,349694,349826,351595,354250,354734,358441,359053,352613,353085,353938,354120,354124,356294,357584,359116,353517,354432,354541,356325,356896,351436,355573,358867,359228))"
          }
        },
        {
          "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",
              "webmarco.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 100,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "100.00",
              "eval_cost": "20.00",
              "prefix_cost": "161.15",
              "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": [
              "webmarco.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 5,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "100.00",
              "eval_cost": "1.00",
              "prefix_cost": "281.15",
              "data_read_per_join": "29K"
            },
            "used_columns": [
              "category_id",
              "usergroup_ids",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`webmarco`.`cscart_categories`.`storefront_id` in (0,1)) and ((`webmarco`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`webmarco`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`webmarco`.`cscart_categories`.`usergroup_ids`)) and (`webmarco`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
349694 2916M
349736 2916M
349772 2916M
349826 2916M
349836 2916M
349887 2916M
349890 2916M
349939 2916M
349943 2916M
350029 2916M
350097 2916M
350268 2913M
350282 2913M
350306 2913M
350308 2913M
350342 2913M
350351 2913M
350368 2913M
350375 2913M
350670 2920M
351045 2920M
351312 2916M
351436 2916M
351499 2920M
351541 2916M
351595 2916M
351612 2916M
351815 2916M
352157 2916M
352170 2916M
352364 2916M
352403 2916M
352530 2916M
352613 2916M
352647 2916M
352803 3105M
353085 3105M
353127 3105M
353459 3105M
353517 3408M
353632 3105M
353662 3105M
353781 3105M
353854 3105M
353938 2920M
354120 3105M
354124 3105M
354169 3408M
354235 3408M
354250 3105M
354261 3105M
354432 2916M
354515 2916M
354541 3105M
354642 2916M
354658 3105M
354659 3105M
354675 3105M
354694 2916M
354714 3408M
354734 2916M
354873 2916M
354938 2920M
355301 2920M
355500 3105M
355537 3408M
355540 3408M
355567 3408M
355573 3408M
355793 2916M
356094 2916M
356228 2916M
356246 2916M
356294 2916M
356306 2916M
356325 2916M
356392 2916M
356506 2916M
356544 2916M
356566 2916M
356645 2916M
356851 3105M
356861 3105M
356896 3105M
357584 2916M
357755 2920M
357764 2920M
357797 2916M
358292 3105M
358441 2916M
358535 2916M
358556 2916M
358670 2916M
358867 2916M
358941 2916M
359035 2916M
359053 2916M
359116 2920M
359228 2920M
359419 2916M