The equation x1x2=x3x4+λ in fields of prime order and applications