conditional writes to redis