Pilot contamination (PC) is known as a dominant factor for the performance of time-division duplex massive MIMO systems. Most of the existing studies of PC assumed perfect inter-cell synchronization, which is too costly to achieve or even impossible in practice. In this paper, we consider the unsynchronized scenario, in which the reused pilot signals from other cells are subject to timing misalignment, and propose a method for pilot sequence design for reducing the mean square error (MSE) of the linear least squares (LS) channel estimation. An analytic MSE formula is first derived, which is a very complicated function of the pilot coefficients. To ease analysis, an upper bound on the MSE is then derived. Through minimization of this upper bound, an analytic solution is obtained. Computer simulations are used to illustrate the performance of the proposed pilot sequence.