Transaction and concurrent clients

Hello , I wrote some transaction and would get some feedback about the robustness of such code:
here is a snippet code , not the final one:


    @fdb.transactional
    def do_some_stuff(self, tr, ref_time):

        if tr['name'].present():
            time = tr[pack('name','time')]
        
        if time < ref_time:

            tr.clear_range_startswith(('name',))
        else:
            tr[pack('name','time')] = time.time()
            tr.add(self.acct_space.pack(('name', 'count')),
                       struct.pack('<i', 2))

Imagine having two clients calling this method with two different ref_time value. Is this code safe by design as using transaction or I should protect with an extra atomic flag

Thank you