UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P79GzY0eIuV+hI+Kgo5vqJ48LRPHkrJYRLQLrPkqXMI='
WHERE
key_id = 'a183dd5f43de57f70d0a1d0ecdf9762398e203b6238feae6c27f7e6cc63fd070'
AND (
token = 'P79GzY0eIuV+hI+Kgo5vqJ48LRPHkrJYRLQLrPkqXMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)