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 (
    9773, 9774, 9775, 9776, 9777, 9778, 9779, 
    9780, 9781, 9782, 9783, 9784, 9785, 
    9786, 9787, 9788, 9789, 9790, 9791, 
    9792, 9793, 9794, 9795, 9796, 9797, 
    9798, 9799, 9800, 9801, 9802, 9803, 
    9804
  ) 
  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.00101

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "76.81"
    },
    "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": 32,
        "rows_produced_per_join": 6,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804))",
        "cost_info": {
          "read_cost": "75.53",
          "eval_cost": "1.28",
          "prefix_cost": "76.81",
          "data_read_per_join": "153"
        },
        "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
9773 309.000000
9774 899.000000
9775 119.000000
9776 105.000000
9777 139.000000
9778 139.000000
9779 149.000000
9780 269.000000
9781 269.000000
9782 299.000000
9783 229.000000
9784 229.000000
9785 199.000000
9786 179.000000
9787 199.000000
9788 199.000000
9789 149.000000
9790 149.000000
9791 369.000000
9792 90.000000
9793 129.000000
9794 199.000000
9795 199.000000
9796 299.000000
9797 349.000000
9798 699.000000
9799 379.000000
9800 139.000000
9801 399.000000
9802 399.000000
9803 399.000000
9804 90.000000