UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ktEzIx523fMkpXK1IHCdp/BQDK92u6/fzZQvJnwEIo='
WHERE
key_id = 'ef55c850bc1911b846deb3e498ac96f12a5fa59f5b7e967f8b8928c47a6e68fb'
AND (
token = '1ktEzIx523fMkpXK1IHCdp/BQDK92u6/fzZQvJnwEIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)