UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zF5uC0VEHZXdY6UuiJYKzGjgOa0Z9yh7neLTaCtAcdY='
WHERE
key_id = '3b9bd83c45bfe9bdfcbe9d6518c70b0af932ac7e0c527c42958fd6d5cfafabe4'
AND (
token = 'zF5uC0VEHZXdY6UuiJYKzGjgOa0Z9yh7neLTaCtAcdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)