SELECT 
  f.feature_id, 
  f.purpose, 
  p.product_id, 
  p.parent_product_id, 
  g.id, 
  g.code 
FROM 
  cscart_product_variation_group_features AS f 
  INNER JOIN cscart_product_variation_groups AS g ON f.group_id = g.id 
  INNER JOIN cscart_product_variation_group_products AS p ON f.group_id = p.group_id 
WHERE 
  p.product_id IN (
    12138, 12137, 12136, 12134, 12133, 12132, 
    12129, 12128, 12127, 12096, 12092, 
    12187, 12083, 31084, 31083, 31082, 
    31081, 31080, 31079, 31078, 31077, 
    31076, 31075, 31074, 31073, 31072, 
    31071, 31070, 31069, 31068, 31067, 
    31066, 31065, 31064, 31063, 31062, 
    31061, 31060, 12060, 12073
  )

Query time 0.00020

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE p ALL PRIMARY,idx_group_id 376 Using where
1 SIMPLE g eq_ref PRIMARY PRIMARY 3 toolboxdigitalshop_dev.p.group_id 1
1 SIMPLE f ref idx_group_id idx_group_id 3 toolboxdigitalshop_dev.p.group_id 7