UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bCg/89eJ1wm5nyZekaweBqoVyvqyKQM5hozG8BmP5S0='
WHERE
key_id = '458f5beab6380e92a4329836bbf923dc94f0940f887ca398a86bf9d5e33d8ef9'
AND (
token = 'bCg/89eJ1wm5nyZekaweBqoVyvqyKQM5hozG8BmP5S0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)