There are laws that prohibit leaving children in a car alone that can result in fines and court attendance.
Under these laws can you be fined for leaving children in a car at a service station while paying for petrol
The legislation varies by state but s494 of the Victorian Children, Young Persons and Families Act is typical.
A person who has the control or charge of a child must not leave the child without making reasonable provision for the child's supervision and care for a time which is unreasonable having regard to all the circumstances of the case.
If the child is 17 years old then the circumstances are such that it is not unreasonable to leave them, even for a period of days. If the child is 17 days old, even 30 seconds may be unreasonable.