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 (
    502, 27002, 46548, 23017, 26889, 44858, 
    26897, 23047, 26876, 40441, 5994, 4512, 
    42111, 26893, 26878, 26888, 26885, 
    26875, 37095, 26881, 26879, 26884, 
    26883, 34676, 40439, 34673, 1718, 31629, 
    37314, 5781, 41205, 40434
  ) 
  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.00167

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 (502,27002,46548,23017,26889,44858,26897,23047,26876,40441,5994,4512,42111,26893,26878,26888,26885,26875,37095,26881,26879,26884,26883,34676,40439,34673,1718,31629,37314,5781,41205,40434)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
502 200000.0000
1718 35000.0000
4512 80000.0000
5781 97900.0000
5994 79000.0000
23017 93000.0000
23047 95000.0000
26875 170000.0000
26876 170000.0000
26878 170000.0000
26879 170000.0000
26881 103000.0000
26883 79000.0000
26884 90000.0000
26885 63000.0000
26888 63000.0000
26889 54000.0000
26893 56000.0000
26897 88000.0000
27002 52000.0000
31629 48000.0000
34673 42000.0000
34676 39000.0000
37095 160000.0000
37314 189000.0000
40434 180000.0000
40439 180000.0000
40441 180000.0000
41205 169000.0000
42111 50000.0000
44858 150000.0000
46548 200000.0000