UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9hDoBDu8BBARh1QOqcpCumxz2klT2QhuQus3IQcnDyU='
WHERE
key_id = '27a020a32c94e956681588a15d0f935e67ec2f9c4fb2147e50d958264ae79839'
AND (
token = '9hDoBDu8BBARh1QOqcpCumxz2klT2QhuQus3IQcnDyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)