SELECT 
  a.category_id 
FROM 
  cscart_categories as a 
  LEFT JOIN cscart_categories as b ON b.category_id IN (1887) 
WHERE 
  a.id_path LIKE CONCAT(b.id_path, '/%')

Query time 0.00058

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "b",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "p_category_id"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "a",
      "access_type": "index",
      "key": "id_path",
      "key_length": "767",
      "used_key_parts": ["id_path"],
      "rows": 427,
      "filtered": 100,
      "attached_condition": "a.id_path like <cache>(concat('1887','/%'))",
      "using_index": true
    }
  }
}

Result

category_id
1877
1878
1879
1881
1882
1883
1884
1885
1980
1986
1888
1889
1890
1891
1892
1893
1894
1895
1982
2010
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1916
1917
1918