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 (
    21631, 21632, 21633, 21634, 21635, 21636, 
    21637, 21638, 21639, 21640, 21641, 
    21642, 21643, 21644, 21645, 21646
  ) 
  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.00032

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": 16,
      "filtered": 99.99243927,
      "index_condition": "cscart_product_prices.product_id in (21631,21632,21633,21634,21635,21636,21637,21638,21639,21640,21641,21642,21643,21644,21645,21646)",
      "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
    }
  }
}

Result

product_id price
21631 2900.00000000
21632 3800.00000000
21633 8050400.00000000
21634 4200.00000000
21635 122900.00000000
21636 850700.00000000
21637 58500.00000000
21638 217100.00000000
21639 880000.00000000
21640 309400.00000000
21641 1528900.00000000
21642 979400.00000000
21643 497600.00000000
21644 235200.00000000
21645 497600.00000000
21646 591400.00000000