You should use the second approach since delay method exits right away without waiting for your task to finish. And the return_value variable will be AsyncResult instance, not the value you wanted to return from my_task. So if you want to update the DB once the task is complete, do it inside the task.
Alternatively you could use on_success handler of the Task class:
class MyTask(Task):
def run(self, *args, **kwargs):
# your task execution code
def on_success(self, retval, task_id, args, kwargs):
# put the retval into the DB