### Apache Airflow version

main (development)

### What happened

Airflow has `job_heartbeat_sec` (default 5) that was updated to 50 seconds in our environment. This caused 2 instances of triggerer process running for HA to keep updating triggerer_id since below query takes current time minus 30 seconds to query against the latest_heartbeat. This causes alive_triggerer_ids to return empty list since job_heartbeat_sec is more than 50 seconds and the current trigger running this query assigns the triggers to itself. This keeps happening moving triggers from one instance to another.

https://github.com/apache/airflow/blob/62a534dbc7fa8ddb4c249ade85c558b64d1630dd/airflow/models/trigger.py#L216-L223

### What you think should happen instead

The heartbeat calculation should have a value based on job_heartbeat_sec rather than 30 seconds hardcoded so that queries to check triggerer processes alive are adjusted as per user settings.

### How to reproduce

1. Change job_heartbeat_sec to 50 in airflow.cfg
2. Run 2 instances of triggerer.
3. Make an operator that uses `FileTrigger` with the file being absent or any other long running task.
4. Check triggerer_id for the trigger which keeps changing. 

### Operating System

Ubuntu

### Versions of Apache Airflow Providers

_No response_

### Deployment

Virtualenv installation

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

trigger_on_healthy_triggerer.id = 1
    trigger_on_healthy_triggerer.triggerer_id = healthy_triggerer.id
    trigger_on_killed_triggerer = Trigger(classpath="airflow.triggers.testing.SuccessTrigger", kwargs={})
    trigger_on_killed_triggerer.id = 2
    trigger_on_killed_triggerer.triggerer_id = finished_triggerer.id
    trigger_unassigned_to_triggerer = Trigger(classpath="airflow.triggers.testing.SuccessTrigger", kwargs={})
    trigger_unassigned_to_triggerer.id = 3
    assert trigger_unassigned_to_triggerer.triggerer_id is None
    session.add(trigger_on_healthy_triggerer)
    session.add(trigger_on_killed_triggerer)
    session.add(trigger_unassigned_to_triggerer)
    session.commit()
    assert session.query(Trigger).count() == 3
    Trigger.assign_unassigned(new_triggerer.id, 100, session=session)
    session.expire_all()
    
    assert (
        session.query(Trigger).filter(Trigger.id == trigger_on_killed_triggerer.id).one().triggerer_id
        == new_triggerer.id
    )
    assert (
        session.query(Trigger).filter(Trigger.id == trigger_unassigned_to_triggerer.id).one().triggerer_id
        == new_triggerer.id
    )
    
    assert (
        session.query(Trigger).filter(Trigger.id == trigger_on_healthy_triggerer.id).one().triggerer_id
        == healthy_triggerer.id
    )
def test_get_sorted_triggers(session, create_task_instance):