UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ArCsTzDF/ZoBKhp0b03FsZG7gUdYabBbXsigq6yG3I4='
WHERE
key_id = '3ca8aea528de4de83dc22f2a793b3951ebf5ea17e6736b52a4025f5d9e6785a2'
AND (
token = 'ArCsTzDF/ZoBKhp0b03FsZG7gUdYabBbXsigq6yG3I4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)