Expenses such as below are in principle recognized based on the service period.
But exceptions apply to those expenses meeting certain condition which allows expense recognition on cash basis. In other words, even if the payment is upfront, a company can claim the full payment amount as expense in the fiscal year which it was settled. Consult with your tax accountant since consistency is also a key in qualifying for this benefit.
Please note that consumption tax is recognized at the point service is provided not when payment is settled.