When we need Redis to do multiple actions in an atomic way, we ususally use lua script. For example
if get key > 0: decr key 1
my ques