Parts of keys that have broken away from other parts almost always need silver soldering. That requires heating to red hot.
Leave it to a tech unless you have experience at silver-soldering (with accurate alignment), and experience at adjusting an octave mechanism to function correctly.
If that is all that is wrong, then at a very wild guess, without seeing it, it might take a tech 10 to 20 minutes.
However the octave mechanism is quite a complicated and delicate piece of mechanism, and many parts of it have to function just right or it fails to work. If it has had enough trauma to break off a part, there may well be other parts of it that need attention. And if it is soldered back a fraction of a mm out of position, then quite a lot of re-adjustment to accommodate may be necessary.
If you mean the key cup itself, the pad will almost certainly need replacing. If silver-soldering is required, then all soft materials subject to heat will need replacing.