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 (
    8790, 8791, 8792, 9050, 9052, 9053, 9054, 
    9055, 9056, 9057, 9058, 9817, 9818, 
    9819, 9820, 9821, 9822, 9823, 9824, 
    9825, 9826, 9827, 9828, 9829, 9830, 
    9831, 9832, 9833, 9834, 9835
  ) 
  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.00096

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "72.01"
    },
    "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": 30,
        "rows_produced_per_join": 5,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (8790,8791,8792,9050,9052,9053,9054,9055,9056,9057,9058,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835))",
        "cost_info": {
          "read_cost": "70.81",
          "eval_cost": "1.20",
          "prefix_cost": "72.01",
          "data_read_per_join": "143"
        },
        "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
8790 105.000000
8791 109.000000
8792 115.000000
9050 105.000000
9052 139.000000
9053 115.000000
9054 115.000000
9055 139.000000
9056 139.000000
9057 105.000000
9058 139.000000
9817 159.000000
9818 189.000000
9819 109.000000
9820 109.000000
9821 159.000000
9822 139.000000
9823 139.000000
9824 99.000000
9825 99.000000
9826 105.000000
9827 115.000000
9828 115.000000
9829 115.000000
9830 139.000000
9831 149.000000
9832 79.000000
9833 109.000000
9834 109.000000
9835 159.000000