How can I get the first and last day of next month to be used in the where clause?
First day of next month is simply last day of this month + 1:
select affffdate(last_day(curdate()), 1)
Last day of next month is simply last day of (today + 1 month):
select last_day(curdate() + interval 1 month))
These are the most straightforward solutions. You'll not be able to find a shorter one.
If you need the first day of the current month, see https://stackoverflow.com/a/28966866/632951