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 (
    3297, 3298, 3299, 3304, 3308, 3309, 3310, 
    3314, 3318, 6845, 6849, 6852, 6853, 
    6856, 6857, 6858, 6862, 6863, 6865, 
    7057, 7058, 7059
  ) 
  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.00094

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "15.41"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "cscart_product_prices",
        "access_type": "range",
        "possible_keys": [
          "usergroup",
          "product_id",
          "lower_limit",
          "usergroup_id"
        ],
        "key": "product_id",
        "used_key_parts": [
          "product_id"
        ],
        "key_length": "3",
        "rows_examined_per_scan": 22,
        "rows_produced_per_join": 4,
        "filtered": "20.00",
        "index_condition": "(`gaseus`.`cscart_product_prices`.`product_id` in (3297,3298,3299,3304,3308,3309,3310,3314,3318,6845,6849,6852,6853,6856,6857,6858,6862,6863,6865,7057,7058,7059))",
        "cost_info": {
          "read_cost": "14.97",
          "eval_cost": "0.44",
          "prefix_cost": "15.41",
          "data_read_per_join": "105"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`gaseus`.`cscart_product_prices`.`lower_limit` = 1) and (`gaseus`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
3297 100.00000000
3298 100.00000000
3299 100.00000000
3304 724.00000000
3308 100.00000000
3309 100.00000000
3310 100.00000000
3314 100.00000000
3318 100.00000000
6845 100.00000000
6849 100.00000000
6852 724.00000000
6853 100.00000000
6856 100.00000000
6857 100.00000000
6858 100.00000000
6862 724.00000000
6863 100.00000000
6865 100.00000000
7057 0.00000000
7058 0.00000000
7059 0.00000000