UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7adn5mL0LNaBYQMmBDY+Iq/uKWk5v4UnsicmcbAHCbk='
WHERE
key_id = '650872b50e7fef97a4f38b25830c639aeffe9713600d6c571e8a9a5abba28427'
AND (
token = '7adn5mL0LNaBYQMmBDY+Iq/uKWk5v4UnsicmcbAHCbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)