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 = 2920 
WHERE 
  cscart_products_categories.product_id IN (
    357038, 358186, 350654, 350889, 351111, 
    359307, 355184, 357857, 350727, 354634, 
    357680, 350718, 355245, 358130, 358146, 
    359166, 351020, 355292, 357278, 359195, 
    359388, 350728, 350801, 357311, 357839, 
    359272, 359313, 351692, 354594, 357977, 
    357996, 358128, 359146, 357042, 358216, 
    350872, 351492, 352774, 351516, 355179, 
    355205, 352287, 357172, 351056, 358166, 
    350828, 350900, 350942, 351017, 357299, 
    357850, 359169, 353933, 357041, 357069, 
    350768, 350823, 350887, 350923, 351129, 
    356169, 357053, 357750, 358206, 350635, 
    351514, 352292, 351499, 354909, 355214, 
    355331, 357099, 351171, 351655, 357257, 
    351219, 356141, 357847, 351041, 351045, 
    356934, 357933, 359097, 351006, 351669, 
    351702, 354910, 355213, 350670, 350809, 
    353938, 357717, 351712, 350755, 351167, 
    351482, 354938, 355301, 357755, 357764
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00325

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 (357038,358186,350654,350889,351111,359307,355184,357857,350727,354634,357680,350718,355245,358130,358146,359166,351020,355292,357278,359195,359388,350728,350801,357311,357839,359272,359313,351692,354594,357977,357996,358128,359146,357042,358216,350872,351492,352774,351516,355179,355205,352287,357172,351056,358166,350828,350900,350942,351017,357299,357850,359169,353933,357041,357069,350768,350823,350887,350923,351129,356169,357053,357750,358206,350635,351514,352292,351499,354909,355214,355331,357099,351171,351655,357257,351219,356141,357847,351041,351045,356934,357933,359097,351006,351669,351702,354910,355213,350670,350809,353938,357717,351712,350755,351167,351482,354938,355301,357755,357764))"
          }
        },
        {
          "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
350635 2920M 0
350654 2920M 0
350670 2920M 0
350718 2920M 0
350727 2920M 0
350728 2920M 0
350755 2920M 0
350768 2920M 0
350801 2920M 0
350809 2920M 0
350823 2920M 0
350828 2920M 0
350872 2920M 0
350887 2920M 0
350889 2920M 0
350900 2920M 0
350923 2920M 0
350942 2920M 0
351006 2920M 0
351017 2920M 0
351020 2920M 0
351041 2920M 0
351045 2920M 0
351056 2920M 0
351111 2920M 0
351129 2920M 0
351167 2920M 0
351171 2920M 0
351219 2920M 0
351482 2920M 0
351492 2920M 0
351499 2920M 0
351514 2920M 0
351516 2920M 0
351655 2920M 0
351669 2920M 0
351692 2920M 0
351702 2920M 0
351712 2920M 0
352287 2920M 0
352292 2920M 0
352774 2920M 0
353933 2920M 0
353938 2920M 0
354594 2920M 0
354634 2920M 0
354909 2920M 0
354910 2920M 0
354938 2920M 0
355179 2920M 0
355184 2920M 0
355205 2920M 0
355213 2920M 0
355214 2920M 0
355245 2920M 0
355292 2920M 0
355301 2920M 0
355331 2920M 0
356141 2920M 0
356169 2920M 0
356934 2920M 0
357038 2920M 0
357041 2920M 0
357042 2920M 0
357053 2920M 0
357069 2920M 0
357099 2920M 0
357172 2920M 0
357257 2920M 0
357278 2920M 0
357299 2920M 0
357311 2920M 0
357680 2920M 0
357717 2920M 0
357750 2920M 0
357755 2920M 0
357764 2920M 0
357839 2920M 0
357847 2920M 0
357850 2920M 0
357857 2920M 0
357933 2920M 0
357977 2920M 0
357996 2920M 0
358128 2920M 0
358130 2920M 0
358146 2920M 0
358166 2920M 0
358186 2920M 0
358206 2920M 0
358216 2920M 0
359097 2920M 0
359146 2920M 0
359166 2920M 0
359169 2920M 0
359195 2920M 0
359272 2920M 0
359307 2920M 0
359313 2920M 0
359388 2920M 0