As the documentation says :
The mongo shell wraps the Date object with the ISODate helper. The ISODate is in UTC.
So my best guess is that your
new Date() is not in UTC.
Math.floor((new Date()).getTime() / 1000)
However, Mongo is smart enough to sort this all out for you, so
new Date() should be enough.
To query a Date in mongo, you can also use pure Date Objects, without the need to convert them to ISOString.
Keep everything as Date Objects, and it'll work as you intend it to!