UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gFfrwdFTACgyPzbmnQpIS8YYVBEKmUI/bPXKVqC9RBU='
WHERE
key_id = '90a8b8623b8ad33210aa9f8cac31e9c7c27a9332e6d042cd9c6eb741e670a380'
AND (
token = 'gFfrwdFTACgyPzbmnQpIS8YYVBEKmUI/bPXKVqC9RBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)