UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HLSYl+nBquLG6k58QmNeuyNIrO1O96R31YQYhKGyWcM='
WHERE
key_id = '63e71ab1ac70fc228f69c87c21385f6fe66e4f23599f70170e9061eaf625b5c8'
AND (
token = 'HLSYl+nBquLG6k58QmNeuyNIrO1O96R31YQYhKGyWcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)