Enabling a texture on an interval

I need to enable a texture on a fixed interval in my material.
My material has a diffuse texture that i want to be always enabled, but i have a mask texture that i want to enable for a short time every 5 seconds.
The goal is to have a “randomized” invisibility effect on my material.

Can you tell me what tool could help me to achieve it ? I’ve searched a lot but i can’t find what i need.

I’m working with UE3, but i guess it should be the same with UE4, so it would help me if you know how to do it with UE4.

Thanks for your help !