SELECT 
  q_product_prices.product_id, 
  MIN(
    IF(
      q_product_prices.percentage_discount = 0, 
      q_product_prices.price, 
      q_product_prices.price - (
        q_product_prices.price * q_product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  q_product_prices 
WHERE 
  q_product_prices.product_id IN (
    6957, 6958, 6959, 6960, 6961, 6962, 6963, 
    6964, 6965, 6966, 6967, 6968, 6969, 
    6970, 6971, 6972, 6974, 6977, 6978, 
    6979, 4497, 4498, 4499, 4500, 4501, 
    4502, 4503, 4504, 4505, 4506, 4507, 
    4509
  ) 
  AND q_product_prices.lower_limit = 1 
  AND q_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  q_product_prices.product_id

Query time 0.00083

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "78.21"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "q_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": 33,
        "rows_produced_per_join": 6,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6974,6977,6978,6979,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4509))",
        "cost_info": {
          "read_cost": "76.89",
          "eval_cost": "1.32",
          "prefix_cost": "78.21",
          "data_read_per_join": "158"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`portal`.`q_product_prices`.`lower_limit` = 1) and (`portal`.`q_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
4497 109.000000
4498 119.000000
4499 259.000000
4500 399.000000
4501 199.000000
4502 489.000000
4503 175.000000
4504 139.000000
4505 99.000000
4506 200.000000
4507 149.000000
4509 99.000000
6957 229.000000
6958 269.000000
6959 175.000000
6960 155.000000
6961 110.000000
6962 25.000000
6963 36.000000
6964 290.000000
6965 290.000000
6966 185.000000
6967 199.000000
6968 250.000000
6969 70.000000
6970 145.000000
6971 299.000000
6972 169.000000
6974 225.000000
6977 140.000000
6978 59.000000
6979 170.000000