SELECT 
  id_path 
FROM 
  cscart_categories 
WHERE 
  category_id IN (275, 277, 296, 371, 372, 387)

Query time 0.00046

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_categories range PRIMARY,p_category_id,idx_category_id PRIMARY 3 6 Using index condition

Result

id_path
258/273/275
258/273/277
258/273/296
257/280/371
257/280/372
386/259/387