UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+rGrHTeu3QvEvzqYRa1eUeQh2XS0Sl3anMtbamjieok='
WHERE
key_id = 'bd664bd098ace0e3511d6c6c6f81a66ccb0bae1c53aa92a735355a13d183c363'
AND (
token = '+rGrHTeu3QvEvzqYRa1eUeQh2XS0Sl3anMtbamjieok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)