Goodness me some of the replies on here are disgusting! It is a huge shock to discover you have cancer at any age and then you have to tell people who love and care about you and it doesn't matter how old your children are a mothering instinct will always be to protect them.
I am so sorry that you are having to face this and I think the best thing is to ask your children to visit and sit them down with the news when you feel ready to do it, they will have questions I expect but if you don't know the answers yet then just explain that you have no way to know and you can only tell them what your specialist has told you so far.
My sister has lung cancer, she's 52 and she only found out it was terminal at the end of August, she had been told there was cancer present 3 weeks prior to that but further testing was needed to see how serious it was which took time and she didn't want many people to know until she was more certain herself, she wanted to protect us all from her pain and was hoping it wasn't advanced but sadly it is and it's a matter of months now.
I admire her so much though, imagine carrying that burden of immense shock and worry but still protecting others, I am heartbroken but I will concentrate on the time we have left together because that is what she wants us all to do.
I have no idea what your treatment options are but I do hope there are some available to you and I don't know much about cancer but I do know that every patient is different, that treatments are being consistently developed and that there are even some very positive outcomes where people have been told the hope is all but gone.
My sister was told she had weeks but they would try chemotherapy despite the fact that they really didn't hold out much hope of it being of any use, she went for a scan last week and her tumours have shrunk, she is starting a drug trial soon and if that doesn't help to keep the cancer controlled then she will either return to chemotherapy or she can have radiotherapy.
Cancer is awful and terrifying, I know I will lose her, there is no way back but hopefully for you there will be options for treatment if you want them because ultimately it must be your choice, that is your right.
I wish you well and your children too, my sister wanted to sit me down and tell me face to face but she had complications during a hospital stay and had 2 cardiac arrests so she couldn't, it was another relative that was told first and then called me with the terrible news, she actually survived both though and is living the best life possible given the circumstances until she is no longer able to.
Don't forget to get as much support for yourself as possible too, as relatives we suffer but as the person with cancer we know you are suffering so much more.