UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+CXq6V6awpIT2nza9zDYJok1fY5KH/0qsHGQ1jyZorM='
WHERE
key_id = 'c87c6f08b9fc108411ab0bd3ac0355d5bb32f7d8a756af9656f34a48e556973e'
AND (
token = '+CXq6V6awpIT2nza9zDYJok1fY5KH/0qsHGQ1jyZorM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)