UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/CCsghyEVhBp6Acv6qxdsNGalv5DZaef36VvI3UFPdw='
WHERE
key_id = '7a00d0e278d884145aa7350073c8b48ed42723257fe88f92a4d113f7c10e00eb'
AND (
token = '/CCsghyEVhBp6Acv6qxdsNGalv5DZaef36VvI3UFPdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)