What could be the cause of my car taking longer than normal to start occasionally?

I have a 2007 ford ranger with 38k miles on it. I recently bought it used a year ago and therefore don't know what has or hasn't been replaced on it. Occasionally for the past 3 months or so maybe once a week or once every other week it takes longer than normal to start. I have to hold the key back for 5 to 6 seconds instead of the normal 2 -3 seconds. After this time it works fine and normally won't happen for another week or two.Battery is fairly new only 1yr and a half old. What could be the cause of this? Is it a concern? I'm due for inspection in may is it ok to wait till then to get it fixed?

Bought a year ago - service is due.

Sounds like an intermittent fuel rail pressure drop. That can be caused by a finicky check valve in the fuel pump. Hard to diagnose when it's intermittent. But next time it happens, turn the key from OFF to RUN 3 times in a row before you turn to start. That will put the pump in prime mode 3 times and build pressure. If it starts right away, that's a sign of a failing check valve.

Why do people buy cars second hand and expect everything to work properly? This always happens - why do you think the last owner sold it.

You don't say if it is petrol or diesel, but it is likely to be a fuel issue and probably a leak allowing air in, but if a diesel it could be heater plugs need replacing, or injectors cleaning or replacing.