This paper proposes a novel transmission policy for an intelligent reflecting surface (IRS) assisted wireless powered sensor network (WPSN). An IRS is deployed to enhance the performance of wireless energy transfer (WET) and wireless information transfer (WIT) by intelligently adjusting phase shifts of each reflecting elements. To achieve its self-sustainability, the IRS needs to collect energy from energy station to support its control circuit operation. Our proposed policy for the considered WPSN is called IRS assisted harvest-then-transmit time switching, which is able to schedule the transmission time slots by switching between energy collection and energy reflection modes. We study the achievable sum throughput of the proposed transmission policy and investigate a joint design of the transmission time slots, the power allocation, as well as the discrete phase shifts of the WET and WIT. This formulates the problem as a mixed-integer non-linear program, which is NP-hard and non-convex. We first relax it to one with continuous phase shifts, and then propose a two-step approach and decompose the original problem into two sub-problems. We solve the first sub-problem with respect to the phase shifts of the WIT in terms of closed-form expression. For the second sub-problem, we consider a special case without the circuit power of each sensor node, the Lagrange dual method and the KKT conditions are applied to derive the optimal closed-form transmission time slots, power allocation, and phase shift of the WET. Then we generalise the case with the circuit power of each sensor node, which can be solved via employing a semi-definite programming relaxation. The optimal discrete phase shifts can be obtained by quantizing the continuous values. Numerical results demonstrate the effectiveness of the proposed policy and validate the beneficial role of the IRS in comparison to the benchmark schemes.