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 (
    40808, 37295, 5772, 351, 4887, 2565, 
    37298, 1052, 1850, 37486, 2155, 6527, 
    26858, 26848, 5759, 47592, 2626, 406, 
    6526, 26862, 3621, 41130, 31622, 4889, 
    37280, 31902, 21746, 2250, 35466, 26863, 
    43796, 1051
  ) 
  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.00591

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 (40808,37295,5772,351,4887,2565,37298,1052,1850,37486,2155,6527,26858,26848,5759,47592,2626,406,6526,26862,3621,41130,31622,4889,37280,31902,21746,2250,35466,26863,43796,1051)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
351 6000000.0000
406 190000.0000
1051 3300000.0000
1052 3100000.0000
1850 330000.0000
2155 220000.0000
2250 1200000.0000
2565 400000.0000
2626 220000.0000
3621 65000.0000
4887 60000.0000
4889 70000.0000
5759 700000.0000
5772 431200.0000
6526 100000.0000
6527 100000.0000
21746 475000.0000
26848 179000.0000
26858 88000.0000
26862 223000.0000
26863 194000.0000
31622 165000.0000
31902 82000.0000
35466 30000.0000
37280 275000.0000
37295 248000.0000
37298 207000.0000
37486 129000.0000
40808 57000.0000
41130 499000.0000
43796 172800.0000
47592 484000.0000