Those two times will (for all intents and purposes) NEVER be equal. Times are accurate down to the millisecond.
What you’re looking to do is set expired to true if expiry date/time is LESS THAN current date/time.
But please note: As I always point out to people trying to do this type of thing, why even bother setting some boolean state for “expired”? Expired is a derived value (that is, it can always be calculated).
At any time, you can check if expiry_date is less than the current date/time. If that condition is true, your thing is expired. If that condition is NOT true, your you thing is not expired.
(And of course, you can think of this conversely as well: If current date/time is less than expiry_date, then the thing is not expired.)