UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qVNwhRz0HHgGcxTX9jYCvxjs1FBsYo3YJaJ1xaYbxlQ='
WHERE
key_id = 'c2a543b9de12a36a39c9e84ff3c6de2095c4609dac43b18204bf4ca6b73b26ef'
AND (
token = 'qVNwhRz0HHgGcxTX9jYCvxjs1FBsYo3YJaJ1xaYbxlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)