UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lSR0hxKNef9UEVSepQTjogaS/MBfHYit/lYoQ92wljk='
WHERE
key_id = 'a73991c71d5f2012bd04599fc61fe4996334f87eef3c6378643080f9031fab9d'
AND (
token = 'lSR0hxKNef9UEVSepQTjogaS/MBfHYit/lYoQ92wljk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)