UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5nZciZmJxGr4gYzUssRH8FeLBCozG00zlGVIeFPEjNw='
WHERE
key_id = '70fc82a7869fc2d3fc950252961d259224932d09b25cf8ebf92bfaba50a2cc1f'
AND (
token = '5nZciZmJxGr4gYzUssRH8FeLBCozG00zlGVIeFPEjNw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)