UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tNVWLHL8D7YzOE01Y0/rDl7CADmLM7i9OrbdSs13n3U='
WHERE
key_id = '0b97d74904fc83192d3f9b750ac222e6a8a067b613fbefccacdb0a88599aab08'
AND (
token = 'tNVWLHL8D7YzOE01Y0/rDl7CADmLM7i9OrbdSs13n3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)