The lattice Boltzmann method (LBM) combined with the immersed boundary method is a common tool to simulate the movement of red blood cel ls (RBCs) through blood vessels. With very few exceptions, such simulations neglect the difference in viscosities between the hemoglobin solution inside the cells and the blood plasma outside, although it is well known that this viscosity contrast can severely affect cell deformation. While it is easy to change the local viscosity in LBM, the challenge is to distinguish whether a given lattice point is inside or outside the RBC at each time step. Here, we present a fast algorithm to solve this issue by tracking the membrane motion and computing the scalar product between the local surface normal and the distance vector between the closest LBM lattice point and the surface. This approach is much faster than, for example, the ray-casting method. With the domain tracking applied, we investigate the shape transition of a RBC in a microchannel for different viscosity contrast and validate our method by comparing with boundary-integral simulations.