UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVkeKLH6C35p5ZYcUir/+yBr8CJ4FrKcNWEZKy5fXAk='
WHERE
key_id = 'cc831b6e83003a54b6cb2bcd27aaa8001eb9d93413b0d328b1b9fbb66bc3a75f'
AND (
token = 'rVkeKLH6C35p5ZYcUir/+yBr8CJ4FrKcNWEZKy5fXAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)