UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K8BsQx8ZzprXq7WZr9JYoSEV/ovukM9ToUa17TyNPEQ='
WHERE
key_id = '3436cbe8be56f08970fa56af8ddce8657b06bd29811dd03864a72807de951612'
AND (
token = 'K8BsQx8ZzprXq7WZr9JYoSEV/ovukM9ToUa17TyNPEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)