SELECT 
  jmj_product_prices.product_id, 
  COALESCE(
    jmj_master_products_storefront_min_price.price, 
    MIN(
      IF(
        jmj_product_prices.percentage_discount = 0, 
        jmj_product_prices.price, 
        jmj_product_prices.price - (
          jmj_product_prices.price * jmj_product_prices.percentage_discount
        )/ 100
      )
    )
  ) AS price 
FROM 
  jmj_product_prices 
  LEFT JOIN jmj_master_products_storefront_min_price ON jmj_master_products_storefront_min_price.product_id = jmj_product_prices.product_id 
  AND jmj_master_products_storefront_min_price.storefront_id = 1 
WHERE 
  jmj_product_prices.product_id IN (
    1705, 1730, 1654, 1662, 1713, 1733, 1682, 
    1675, 1702, 1728, 1719, 1511, 1517, 
    1523, 1526, 1645, 1647, 1670, 1659, 
    1656, 1723, 1668, 1679, 1696, 1731, 
    1699, 1732, 1707, 1697, 1735, 1695, 
    1686, 1734, 1721, 1729, 814, 816, 817, 
    818, 819, 820, 821, 822, 823, 825, 826, 
    827, 828, 895, 899, 901, 902, 813, 1460, 
    830, 868, 869, 870, 904, 905, 906, 907, 
    908, 909, 917, 920, 921, 922, 923, 924, 
    1105, 1109, 1110, 1111, 1112, 1113, 
    1114, 1115, 1116, 1117, 1118, 1119, 
    1120, 1122, 1123, 1150, 1151, 1152, 
    1059, 1060, 1032, 1033, 1034, 1035, 
    1036, 1037
  ) 
  AND jmj_product_prices.lower_limit = 1 
  AND jmj_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  jmj_product_prices.product_id

Query time 0.00681

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "446.64"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "192.00"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "jmj_product_prices",
            "access_type": "ALL",
            "possible_keys": [
              "usergroup",
              "product_id",
              "lower_limit",
              "usergroup_id"
            ],
            "rows_examined_per_scan": 1037,
            "rows_produced_per_join": 191,
            "filtered": "18.51",
            "cost_info": {
              "read_cost": "175.81",
              "eval_cost": "38.40",
              "prefix_cost": "214.21",
              "data_read_per_join": "4K"
            },
            "used_columns": [
              "product_id",
              "price",
              "percentage_discount",
              "lower_limit",
              "usergroup_id"
            ],
            "attached_condition": "((`jmj_test`.`jmj_product_prices`.`lower_limit` = 1) and (`jmj_test`.`jmj_product_prices`.`product_id` in (1705,1730,1654,1662,1713,1733,1682,1675,1702,1728,1719,1511,1517,1523,1526,1645,1647,1670,1659,1656,1723,1668,1679,1696,1731,1699,1732,1707,1697,1735,1695,1686,1734,1721,1729,814,816,817,818,819,820,821,822,823,825,826,827,828,895,899,901,902,813,1460,830,868,869,870,904,905,906,907,908,909,917,920,921,922,923,924,1105,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1122,1123,1150,1151,1152,1059,1060,1032,1033,1034,1035,1036,1037)) and (`jmj_test`.`jmj_product_prices`.`usergroup_id` in (0,1)))"
          }
        },
        {
          "table": {
            "table_name": "jmj_master_products_storefront_min_price",
            "access_type": "ALL",
            "possible_keys": [
              "PRIMARY"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 191,
            "filtered": "100.00",
            "using_join_buffer": "Block Nested Loop",
            "cost_info": {
              "read_cost": "2.03",
              "eval_cost": "38.40",
              "prefix_cost": "254.64",
              "data_read_per_join": "2K"
            },
            "used_columns": [
              "storefront_id",
              "product_id",
              "price"
            ],
            "attached_condition": "<if>(is_not_null_compl(jmj_master_products_storefront_min_price), ((`jmj_test`.`jmj_master_products_storefront_min_price`.`storefront_id` = 1) and (`jmj_test`.`jmj_master_products_storefront_min_price`.`product_id` = `jmj_test`.`jmj_product_prices`.`product_id`)), true)"
          }
        }
      ]
    }
  }
}

Result

product_id price
813 299.00000000
814 449.00000000
816 369.00000000
817 369.00000000
818 369.00000000
819 349.00000000
820 379.00000000
821 379.00000000
822 449.00000000
823 369.00000000
825 369.00000000
826 349.00000000
827 449.00000000
828 449.00000000
830 260.00000000
868 285.00000000
869 260.00000000
870 285.00000000
895 369.00000000
899 425.00000000
901 440.00000000
902 370.00000000
904 260.00000000
905 330.00000000
906 285.00000000
907 310.00000000
908 290.00000000
909 280.00000000
917 350.00000000
920 330.00000000
921 330.00000000
922 330.00000000
923 330.00000000
924 330.00000000
1032 1395.00000000
1033 1495.00000000
1034 2295.00000000
1035 1495.00000000
1036 1395.00000000
1037 1795.00000000
1059 2695.00000000
1060 5995.00000000
1105 630.00000000
1109 585.00000000
1110 510.00000000
1111 550.00000000
1112 600.00000000
1113 580.00000000
1114 580.00000000
1115 550.00000000
1116 630.00000000
1117 550.00000000
1118 560.00000000
1119 550.00000000
1120 630.00000000
1122 640.00000000
1123 590.00000000
1150 480.00000000
1151 640.00000000
1152 620.00000000
1460 500.00000000
1511 850.00000000
1517 800.00000000
1523 750.00000000
1526 2400.00000000
1645 799.00000000
1647 425.00000000
1654 425.00000000
1656 855.00000000
1659 1049.00000000
1662 850.00000000
1668 699.00000000
1670 1150.00000000
1675 749.00000000
1679 795.00000000
1682 449.00000000
1686 549.00000000
1695 499.00000000
1696 449.00000000
1697 747.00000000
1699 786.00000000
1702 1484.00000000
1705 1627.00000000
1707 5099.00000000
1713 999.00000000
1719 566.00000000
1721 1268.00000000
1723 674.00000000
1728 1299.00000000
1729 1289.00000000
1730 459.00000000
1731 499.00000000
1732 799.00000000
1733 1374.00000000
1734 654.00000000
1735 909.00000000