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 = 2688 
WHERE 
  cscart_products_categories.product_id IN (
    185415, 185391, 185376, 185375, 185380, 
    185377, 185395, 185385, 185416, 185379, 
    185392, 185393, 185386, 185422, 185378, 
    185402, 185383, 185388, 185425, 185382, 
    185400, 185394, 185403, 185387, 185381, 
    185409, 185419, 185397, 185384, 185413, 
    185429, 185424, 185411, 185423, 185421, 
    185404, 185398, 185399, 185407, 185412, 
    185405, 185414, 185418, 185396, 185427, 
    185417, 185428, 185406, 185408, 185431, 
    185389, 185390, 185401, 185426, 185432, 
    185420, 185430, 185410
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00136

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "163.49"
    },
    "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": 58,
            "rows_produced_per_join": 58,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "12.69",
              "eval_cost": "11.60",
              "prefix_cost": "24.29",
              "data_read_per_join": "928"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`webmarco`.`cscart_products_categories`.`product_id` in (185415,185391,185376,185375,185380,185377,185395,185385,185416,185379,185392,185393,185386,185422,185378,185402,185383,185388,185425,185382,185400,185394,185403,185387,185381,185409,185419,185397,185384,185413,185429,185424,185411,185423,185421,185404,185398,185399,185407,185412,185405,185414,185418,185396,185427,185417,185428,185406,185408,185431,185389,185390,185401,185426,185432,185420,185430,185410))"
          }
        },
        {
          "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": 58,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "58.00",
              "eval_cost": "11.60",
              "prefix_cost": "93.89",
              "data_read_per_join": "928"
            },
            "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": 2,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "58.00",
              "eval_cost": "0.58",
              "prefix_cost": "163.49",
              "data_read_per_join": "17K"
            },
            "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
185375 2716M
185376 2716M
185377 2716M
185378 2716M
185379 2716M
185380 2716M
185381 2716M
185382 2716M
185383 2716M
185384 2716M
185385 2716M
185386 2716M
185387 2716M
185388 2716M
185389 2716M
185390 2716M
185391 2716M
185392 2716M
185393 2716M
185394 2716M
185395 2716M
185396 2716M
185397 2716M
185398 2716M
185399 2716M
185400 2716M
185401 2716M
185402 2716M
185403 2716M
185404 2716M
185405 2716M
185406 2716M
185407 2716M
185408 2716M
185409 2716M
185410 2716M
185411 2716M
185412 2716M
185413 2716M
185414 2716M
185415 2716M
185416 2716M
185417 2716M
185418 2716M
185419 2716M
185420 2716M
185421 2716M
185422 2716M
185423 2716M
185424 2716M
185425 2716M
185426 2716M
185427 2716M
185428 2716M
185429 2716M
185430 2716M
185431 2716M
185432 2716M