UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fhmqQuc1gfako+rNrZ21QaYke26p17tc8XfP4qNuKTE='
WHERE
key_id = '85bd882149a2850e6715e2d109d1ad1d528e23af0a7dda130d2047a43e3b5c2a'
AND (
token = 'fhmqQuc1gfako+rNrZ21QaYke26p17tc8XfP4qNuKTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)