SELECT 
  cscart_product_prices.product_id, 
  COALESCE(
    cscart_master_products_storefront_min_price.price, 
    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 
  LEFT JOIN cscart_master_products_storefront_min_price ON cscart_master_products_storefront_min_price.product_id = cscart_product_prices.product_id 
  AND cscart_master_products_storefront_min_price.storefront_id = 1 
WHERE 
  cscart_product_prices.product_id IN (
    17, 180, 786967, 230, 231, 18, 16, 4, 5, 
    23, 24, 170, 1, 22, 149, 3351, 227, 78, 
    79, 190, 189, 3438, 3439, 3440, 3441, 
    162, 159, 158, 245, 238, 239, 242, 243, 
    241, 240, 214, 217, 218, 207, 59, 58, 
    60, 199, 198, 94, 96, 201, 114, 192, 136, 
    130, 128, 126, 131, 177, 186, 185, 179, 
    11, 172, 78822, 134, 135, 195
  ) 
  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.00367

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.263454463,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_prices",
          "access_type": "range",
          "possible_keys": [
            "usergroup",
            "product_id",
            "lower_limit",
            "usergroup_id",
            "wdbi_product_id_lower_limit_usergroup_id_price_eff1727beeef",
            "wdbi_usergroup_id_lower_limit_product_id_92b7e8f6a250",
            "wdbi_product_id_lower_limit_usergroup_id_price_perc_3b2301d551d0",
            "wdbi_lower_limit_usergroup_id_product_id_b93629431718"
          ],
          "key": "usergroup",
          "key_length": "9",
          "used_key_parts": ["product_id", "usergroup_id", "lower_limit"],
          "loops": 1,
          "rows": 128,
          "cost": 0.22335624,
          "filtered": 20,
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.product_id in (17,180,786967,230,231,18,16,4,5,23,24,170,1,22,149,3351,227,78,79,190,189,3438,3439,3440,3441,162,159,158,245,238,239,242,243,241,240,214,217,218,207,59,58,60,199,198,94,96,201,114,192,136,130,128,126,131,177,186,185,179,11,172,78822,134,135,195) and cscart_product_prices.usergroup_id in (0,1)"
        }
      },
      {
        "table": {
          "table_name": "cscart_master_products_storefront_min_price",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "8",
          "used_key_parts": ["product_id", "storefront_id"],
          "ref": [
            "u985510652_ecartify_abhi.cscart_product_prices.product_id",
            "const"
          ],
          "loops": 25.6,
          "rows": 1,
          "cost": 0.023716864,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_master_products_storefront_min_price.product_id = cscart_product_prices.product_id)"
        }
      }
    ]
  }
}

Result

product_id price
1 5399.99000000
4 699.99000000
5 899.99000000
11 30.00000000
16 349.99000000
17 110.10000000
18 0.00000000
22 799.99000000
23 599.99000000
24 449.99000000
58 779.00000000
59 599.00000000
60 1499.00000000
78 100.00000000
79 96.00000000
94 59.99000000
96 99.99000000
114 14.99000000
126 129.99000000
128 17.99000000
130 49.95000000
131 1249.00000000
134 89.99000000
135 0.00000000
136 0.00000000
149 53.99000000
158 4750.00000000
159 11375.00000000
162 32750.00000000
170 145.99000000
172 299.99000000
177 400.00000000
179 299.97000000
180 180.00000000
185 139.99000000
186 299.99000000
189 1.00000000
190 899.95000000
192 15.00000000
195 29.99000000
198 17.99000000
199 29.98000000
201 12.67000000
207 42.00000000
214 972.00000000
217 610.99000000
218 459.99000000
227 699.00000000
230 12.00000000
231 99.00000000
238 499.99000000
239 509.99000000
240 499.00000000
241 499.00000000
242 249.00000000
243 249.00000000
245 699.00000000
3351 0.00000000
3438 7363.44000000
3439 7363.44000000
3440 7363.44000000
3441 7363.44000000
78822 10.00000000
786967 79.95000000