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 = 2837 
WHERE 
  cscart_products_categories.product_id IN (
    82071, 82118, 82073, 82038, 149042, 
    82061, 81948, 82009, 82101, 81647, 
    82133, 82103, 81737, 81655, 82104, 
    81704, 81826, 81863, 81741, 81860, 
    81702, 82072, 81634, 81657, 366904, 
    389637, 81739, 81625, 82115, 81776, 
    82074, 81611, 81862, 81627, 366903, 
    82114, 82069, 81773, 81636, 152085, 
    368409, 366900, 366968, 372041, 391071, 
    81624, 82099, 82052, 82096, 391278, 
    359756, 390761, 424699, 430332, 81747, 
    391070, 82116, 82095, 435209, 435210, 
    430344, 430333, 430573, 430346, 430347, 
    435211, 430329
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00269

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "264.35"
    },
    "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": 94,
            "rows_produced_per_join": 94,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "19.95",
              "eval_cost": "18.80",
              "prefix_cost": "38.75",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`webmarco`.`cscart_products_categories`.`product_id` in (82071,82118,82073,82038,149042,82061,81948,82009,82101,81647,82133,82103,81737,81655,82104,81704,81826,81863,81741,81860,81702,82072,81634,81657,366904,389637,81739,81625,82115,81776,82074,81611,81862,81627,366903,82114,82069,81773,81636,152085,368409,366900,366968,372041,391071,81624,82099,82052,82096,391278,359756,390761,424699,430332,81747,391070,82116,82095,435209,435210,430344,430333,430573,430346,430347,435211,430329))"
          }
        },
        {
          "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": 94,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "94.00",
              "eval_cost": "18.80",
              "prefix_cost": "151.55",
              "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": 4,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "94.00",
              "eval_cost": "0.94",
              "prefix_cost": "264.35",
              "data_read_per_join": "27K"
            },
            "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
81611 2905M
81624 2904M
81625 2904M
81627 2904M
81634 2904M
81636 2904M
81647 2904M
81655 2904M
81657 2904M
81702 2904M
81704 2904M
81737 2904M
81739 2904M
81741 2904M
81747 2904M
81773 2904M
81776 2904M
81826 2904M
81860 2904M
81862 2904M
81863 2904M
81948 2904M
82009 2904M
82038 2904M
82052 2904M
82061 2904M
82069 2904M
82071 2904M
82072 2904M
82073 2904M
82074 2904M
82095 2904M
82096 2904M
82099 2904M
82101 2904M
82103 2904M
82104 2904M
82114 2904M
82115 2904M
82116 2904M
82118 2904M
82133 2904M
149042 2904M
152085 2898M
359756 2656,2837,9257M 0
366900 2902,9746
366903 2902,9746
366904 2902,9986M
366968 2902
368409 2902M
372041 2898,2653M
389637 2902,9746,9986M
390761 2837M 0
391070 2905
391071 2905
391278 2837M 0
424699 2902,9746,9986M
430329 2905
430332 2905
430333 2905
430344 2837M 0
430346 2905
430347 2905
430573 2905
435209 2902,9746
435210 2902,9746
435211 2905