SELECT 
  cscart_product_prices.product_id, 
  MIN(
    IF(
      cscart_product_prices.percentage_discount = 0, 
      cscart_product_prices.price, 
      cscart_product_prices.price - (
        cscart_product_prices.price * cscart_product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  cscart_product_prices 
WHERE 
  cscart_product_prices.product_id IN (
    5578, 5472, 5457, 5588, 5462, 5579, 5590, 
    5478, 5580, 31887, 31891, 5960, 5957, 
    5961, 31894, 16802, 35733, 5448, 31893, 
    4363, 5956, 31895, 4361, 5451, 5479, 
    4366, 4360, 5591, 5485, 5587, 31889, 
    5963
  ) 
  AND cscart_product_prices.lower_limit = 1 
  AND cscart_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  cscart_product_prices.product_id

Query time 0.00156

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_prices",
          "access_type": "range",
          "possible_keys": [
            "usergroup",
            "product_id",
            "lower_limit",
            "usergroup_id"
          ],
          "key": "product_id",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "rows": 32,
          "filtered": 99.9960556,
          "index_condition": "cscart_product_prices.product_id in (5578,5472,5457,5588,5462,5579,5590,5478,5580,31887,31891,5960,5957,5961,31894,16802,35733,5448,31893,4363,5956,31895,4361,5451,5479,4366,4360,5591,5485,5587,31889,5963)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
4360 810000.0000
4361 850000.0000
4363 1480000.0000
4366 980000.0000
5448 4450000.0000
5451 4650000.0000
5457 3350000.0000
5462 1390000.0000
5472 1390000.0000
5478 960000.0000
5479 960000.0000
5485 770000.0000
5578 880000.0000
5579 780000.0000
5580 880000.0000
5587 145000.0000
5588 145000.0000
5590 145000.0000
5591 145000.0000
5956 1200000.0000
5957 1200000.0000
5960 3900000.0000
5961 3900000.0000
5963 3500000.0000
16802 1550000.0000
31887 550000.0000
31889 550000.0000
31891 550000.0000
31893 550000.0000
31894 700000.0000
31895 700000.0000
35733 1500000.0000