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 (
    10456, 
    10455, 
    12702, 
    10446, 
    12579, 
    12580, 
    12700, 
    10444, 
    10443, 
    10442, 
    10441, 
    10440, 
    10439, 
    10438, 
    10437, 
    10436, 
    10435, 
    10434, 
    10433, 
    10432, 
    10431, 
    10430, 
    10429, 
    10428, 
    10427, 
    10426, 
    10425, 
    12564, 
    10424, 
    10423, 
    10422, 
    10421, 
    10420, 
    10419, 
    10418, 
    10417, 
    12856, 
    10416, 
    10415, 
    10414, 
    12855, 
    12854, 
    12853, 
    10412, 
    10411, 
    10410, 
    10409, 
    10408, 
    10407, 
    10406, 
    15781, 
    10405, 
    10404, 
    10403, 
    10402, 
    10401, 
    10400, 
    10399, 
    10398, 
    10397, 
    10395, 
    10394, 
    10393, 
    10392, 
    10390, 
    10389, 
    10388, 
    10387, 
    10386, 
    10384, 
    10383, 
    10382, 
    12679, 
    12678, 
    12677, 
    12676, 
    12675, 
    12674, 
    12673, 
    15779, 
    12672, 
    12671, 
    12994, 
    12993, 
    12992, 
    12991, 
    12990, 
    12989, 
    12988, 
    12987, 
    12986, 
    12985, 
    10343, 
    10345, 
    10346, 
    10347, 
    10348, 
    10349, 
    10323, 
    10350, 
    10370, 
    10324, 
    10351, 
    10371, 
    10325, 
    10352, 
    10372, 
    10305, 
    10326, 
    10353, 
    10373, 
    10306, 
    10327, 
    10354, 
    10374, 
    10307, 
    10328, 
    10355, 
    10375, 
    10308, 
    10329, 
    10356, 
    10376, 
    10309, 
    10330, 
    10357, 
    10377, 
    10310
  ) 
  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.00231

JSON explain

{
  "query_block": {
    "select_id": 1,
    "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": 128,
      "filtered": 99.23484039,
      "index_condition": "cscart_product_prices.product_id in (10456,10455,12702,10446,12579,12580,12700,10444,10443,10442,10441,10440,10439,10438,10437,10436,10435,10434,10433,10432,10431,10430,10429,10428,10427,10426,10425,12564,10424,10423,10422,10421,10420,10419,10418,10417,12856,10416,10415,10414,12855,12854,12853,10412,10411,10410,10409,10408,10407,10406,15781,10405,10404,10403,10402,10401,10400,10399,10398,10397,10395,10394,10393,10392,10390,10389,10388,10387,10386,10384,10383,10382,12679,12678,12677,12676,12675,12674,12673,15779,12672,12671,12994,12993,12992,12991,12990,12989,12988,12987,12986,12985,10343,10345,10346,10347,10348,10349,10323,10350,10370,10324,10351,10371,10325,10352,10372,10305,10326,10353,10373,10306,10327,10354,10374,10307,10328,10355,10375,10308,10329,10356,10376,10309,10330,10357,10377,10310)",
      "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
    }
  }
}

Result

product_id price
10305 3225.60000000
10306 3225.60000000
10307 3225.60000000
10308 3225.60000000
10309 3225.60000000
10310 3225.60000000
10323 518.70000000
10324 518.70000000
10325 518.70000000
10326 518.70000000
10327 518.70000000
10328 518.70000000
10329 518.70000000
10330 518.70000000
10343 2121.60000000
10345 2121.60000000
10346 2121.60000000
10347 2121.60000000
10348 2121.60000000
10349 2121.60000000
10350 2121.60000000
10351 2121.60000000
10352 2121.60000000
10353 2121.60000000
10354 2121.60000000
10355 2121.60000000
10356 2121.60000000
10357 2121.60000000
10370 2763.44000000
10371 2763.44000000
10372 2763.44000000
10373 2763.44000000
10374 2763.44000000
10375 2763.44000000
10376 2763.44000000
10377 2763.44000000
10382 4944.00000000
10383 4944.00000000
10384 4944.00000000
10386 2540.59000000
10387 2540.59000000
10388 2540.59000000
10389 2540.59000000
10390 2540.59000000
10392 2540.59000000
10393 2540.59000000
10394 2540.59000000
10395 2540.59000000
10397 1326.01000000
10398 1326.01000000
10399 1326.01000000
10400 1326.01000000
10401 1326.01000000
10402 1326.01000000
10403 1317.94000000
10404 1317.94000000
10405 1317.94000000
10406 1317.94000000
10407 1317.94000000
10408 1317.94000000
10409 1317.94000000
10410 1317.94000000
10411 1317.94000000
10412 1317.94000000
10414 1317.94000000
10415 1317.94000000
10416 1317.94000000
10417 1317.94000000
10418 1317.94000000
10419 1317.94000000
10420 1317.94000000
10421 1317.94000000
10422 1317.94000000
10423 1317.94000000
10424 1317.94000000
10425 1671.44000000
10426 1671.44000000
10427 1671.44000000
10428 1671.44000000
10429 1671.44000000
10430 1671.44000000
10431 1671.44000000
10432 1671.44000000
10433 1671.44000000
10434 1671.44000000
10435 1671.44000000
10436 1671.44000000
10437 1671.44000000
10438 1671.44000000
10439 1671.44000000
10440 1671.44000000
10441 1671.44000000
10442 1671.44000000
10443 1671.44000000
10444 1671.44000000
10446 3409.73000000
10455 1894.30000000
10456 1894.30000000
12564 67629.15000000
12579 10072.36000000
12580 11031.68000000
12671 921.36000000
12672 921.36000000
12673 921.36000000
12674 921.36000000
12675 921.36000000
12676 921.36000000
12677 921.36000000
12678 921.36000000
12679 921.36000000
12700 1326.01000000
12702 2150.58000000
12853 1317.94000000
12854 1317.94000000
12855 1317.94000000
12856 1317.94000000
12985 921.36000000
12986 921.36000000
12987 921.36000000
12988 921.36000000
12989 921.36000000
12990 921.36000000
12991 921.36000000
12992 921.36000000
12993 921.36000000
12994 921.36000000
15779 921.36000000
15781 1317.94000000