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 (
    3628, 3629, 3630, 3631, 3632, 3633, 3634, 
    3635, 3636, 3637, 3638, 3639, 3640, 
    3641, 3642, 3643, 3644, 3645, 3646, 
    3647, 3648, 3649, 3650, 3651, 3652, 
    3653, 3654, 3655, 3656, 3657, 3658, 
    3659
  ) 
  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.00077

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 (3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659))",
        "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
3628 86.000000
3629 91.000000
3630 19.000000
3631 21.000000
3632 24.000000
3633 32.000000
3634 31.000000
3635 36.000000
3636 44.000000
3637 12.000000
3638 12.000000
3639 14.000000
3640 6.000000
3641 9.000000
3642 11.000000
3643 9.000000
3644 14.000000
3645 12.000000
3646 69.000000
3647 12.000000
3648 49.000000
3649 14.000000
3650 31.000000
3651 54.000000
3652 54.000000
3653 54.000000
3654 79.000000
3655 79.000000
3656 79.000000
3657 79.000000
3658 79.000000
3659 79.000000