UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0xtJel5rPDxU/VChFX5uBtpG/ULLqdWRyrWp5HGKLBA='
WHERE
key_id = 'bf4c02cc895aa7601691b074f7f89f4d5613ca5327feb6407e732583c6336380'
AND (
token = '0xtJel5rPDxU/VChFX5uBtpG/ULLqdWRyrWp5HGKLBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)